changeset 10770:aefda57f2ae9

8193798: Cherry pick GTK WebKit 2.18.4 changes Reviewed-by: kcr, ghb, mbilla
author arajkumar
date Fri, 05 Jan 2018 11:40:42 +0530
parents 14621a723393
children 2208b2c8200d
files modules/javafx.web/src/main/native/CMakeLists.txt modules/javafx.web/src/main/native/Source/JavaScriptCore/CMakeLists.txt modules/javafx.web/src/main/native/Source/JavaScriptCore/bindings/ScriptValue.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/bindings/ScriptValue.h modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGArrayMode.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGGraph.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGGraph.h modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ConsoleMessage.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScript.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptBase.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorFrontendRouter.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorValues.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorValues.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ScriptCallFrame.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ScriptCallStack.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorAgent.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generator.py modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSONObject.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSObject.cpp modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/Lookup.h modules/javafx.web/src/main/native/Source/WTF/wtf/CMakeLists.txt modules/javafx.web/src/main/native/Source/WTF/wtf/JSONValues.cpp modules/javafx.web/src/main/native/Source/WTF/wtf/JSONValues.h modules/javafx.web/src/main/native/Source/WebCore/ForwardingHeaders/inspector/InspectorValues.h modules/javafx.web/src/main/native/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp modules/javafx.web/src/main/native/Source/WebCore/Modules/mediastream/SDPProcessor.cpp modules/javafx.web/src/main/native/Source/WebCore/PlatformGTK.cmake modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm modules/javafx.web/src/main/native/Source/WebCore/dom/Element.h modules/javafx.web/src/main/native/Source/WebCore/dom/MutationCallback.h modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserver.cpp modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserverInterestGroup.cpp modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserverInterestGroup.h modules/javafx.web/src/main/native/Source/WebCore/dom/NativeNodeFilter.cpp modules/javafx.web/src/main/native/Source/WebCore/dom/NativeNodeFilter.h modules/javafx.web/src/main/native/Source/WebCore/dom/Node.cpp modules/javafx.web/src/main/native/Source/WebCore/dom/Node.h modules/javafx.web/src/main/native/Source/WebCore/dom/NodeFilter.h modules/javafx.web/src/main/native/Source/WebCore/dom/TreeScope.cpp modules/javafx.web/src/main/native/Source/WebCore/html/parser/XSSAuditorDelegate.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/CommandLineAPIHost.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/CommandLineAPIHost.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCSSAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCSSAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCanvas.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCanvas.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMStorageAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDatabaseAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDatabaseResource.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorIndexedDBAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorNetworkAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorNetworkAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorPageAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorShaderProgram.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorStyleSheet.h modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorTimelineAgent.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorTimelineAgent.h modules/javafx.web/src/main/native/Source/WebCore/inspector/TimelineRecordFactory.cpp modules/javafx.web/src/main/native/Source/WebCore/inspector/TimelineRecordFactory.h modules/javafx.web/src/main/native/Source/WebCore/loader/FrameLoader.h modules/javafx.web/src/main/native/Source/WebCore/loader/ResourceTimingInformation.cpp modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.cpp modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.h modules/javafx.web/src/main/native/Source/WebCore/page/csp/ContentSecurityPolicy.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/GLContext.h modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp modules/javafx.web/src/main/native/Source/WebCore/svg/SVGAnimatedTypeAnimator.h modules/javafx.web/src/main/native/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h modules/javafx.web/src/main/native/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h modules/javafx.web/src/main/native/Source/WebCore/testing/Internals.cpp modules/javafx.web/src/main/native/Source/cmake/OptionsGTK.cmake modules/javafx.web/src/main/native/Source/cmake/OptionsWPE.cmake modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/waylanddriver.py modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/westondriver.py modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/westondriver_unittest.py modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/wpe.py modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/xorgdriver.py modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/xvfbdriver.py modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/style/checker.py modules/javafx.web/src/main/native/Tools/wpe/jhbuild.modules
diffstat 122 files changed, 1986 insertions(+), 1898 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.web/src/main/native/CMakeLists.txt	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/CMakeLists.txt	Fri Jan 05 11:40:42 2018 +0530
@@ -1,8 +1,17 @@
 # -----------------------------------------------------------------------------
 # Determine CMake version and build type.
 # -----------------------------------------------------------------------------
+#
+# NOTE: cmake_minimum_required() and project() *MUST* be the two fist commands
+# used, see https://cmake.org/cmake/help/v3.3/command/project.html -- the
+# latter in particular handles loading a bunch of shared CMake definitions
+# and loading the cross-compilation settings from CMAKE_TOOLCHAIN_FILE.
+#
+
 cmake_minimum_required(VERSION 3.3)
 
+project(WebKit)
+
 if (NOT CMAKE_BUILD_TYPE)
     message(WARNING "No CMAKE_BUILD_TYPE value specified, defaulting to RelWithDebInfo.")
     set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
@@ -10,8 +19,6 @@
     message(STATUS "The CMake build type is: ${CMAKE_BUILD_TYPE}")
 endif ()
 
-project(WebKit)
-
 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/Source/cmake")
 
 set(ENABLE_WEBCORE ON)
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/CMakeLists.txt	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/CMakeLists.txt	Fri Jan 05 11:40:42 2018 +0530
@@ -553,7 +553,6 @@
     inspector/InspectorAgentRegistry.cpp
     inspector/InspectorFrontendRouter.cpp
     inspector/InspectorBackendDispatcher.cpp
-    inspector/InspectorValues.cpp
     inspector/JSGlobalObjectConsoleClient.cpp
     inspector/JSGlobalObjectInspectorController.cpp
     inspector/JSGlobalObjectScriptDebugServer.cpp
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/bindings/ScriptValue.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/bindings/ScriptValue.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -32,7 +32,6 @@
 
 #include "APICast.h"
 #include "CatchScope.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "JSLock.h"
 
@@ -41,7 +40,7 @@
 
 namespace Inspector {
 
-static RefPtr<InspectorValue> jsToInspectorValue(ExecState& scriptState, JSValue value, int maxDepth)
+static RefPtr<JSON::Value> jsToInspectorValue(ExecState& scriptState, JSValue value, int maxDepth)
 {
     if (!value) {
         ASSERT_NOT_REACHED();
@@ -54,19 +53,19 @@
     maxDepth--;
 
     if (value.isUndefinedOrNull())
-        return InspectorValue::null();
+        return JSON::Value::null();
     if (value.isBoolean())
-        return InspectorValue::create(value.asBoolean());
+        return JSON::Value::create(value.asBoolean());
     if (value.isNumber() && value.isDouble())
-        return InspectorValue::create(value.asNumber());
+        return JSON::Value::create(value.asNumber());
     if (value.isNumber() && value.isAnyInt())
-        return InspectorValue::create(static_cast<int>(value.asAnyInt()));
+        return JSON::Value::create(static_cast<int>(value.asAnyInt()));
     if (value.isString())
-        return InspectorValue::create(asString(value)->value(&scriptState));
+        return JSON::Value::create(asString(value)->value(&scriptState));
 
     if (value.isObject()) {
         if (isJSArray(value)) {
-            auto inspectorArray = InspectorArray::create();
+            auto inspectorArray = JSON::Array::create();
             auto& array = *asArray(value);
             unsigned length = array.length();
             for (unsigned i = 0; i < length; i++) {
@@ -77,7 +76,7 @@
             }
             return WTFMove(inspectorArray);
         }
-        auto inspectorObject = InspectorObject::create();
+        auto inspectorObject = JSON::Object::create();
         auto& object = *value.getObject();
         PropertyNameArray propertyNames(&scriptState, PropertyNameMode::Strings);
         object.methodTable()->getOwnPropertyNames(&object, &scriptState, propertyNames, EnumerationMode());
@@ -94,12 +93,12 @@
     return nullptr;
 }
 
-RefPtr<InspectorValue> toInspectorValue(ExecState& state, JSValue value)
+RefPtr<JSON::Value> toInspectorValue(ExecState& state, JSValue value)
 {
     // FIXME: Maybe we should move the JSLockHolder stuff to the callers since this function takes a JSValue directly.
     // Doing the locking here made sense when we were trying to abstract the difference between multiple JavaScript engines.
     JSLockHolder holder(&state);
-    return jsToInspectorValue(state, value, InspectorValue::maxDepth);
+    return jsToInspectorValue(state, value, JSON::Value::maxDepth);
 }
 
 } // namespace Inspector
@@ -166,10 +165,10 @@
     return getCallData(m_value.get(), callData) != CallType::None;
 }
 
-RefPtr<InspectorValue> ScriptValue::toInspectorValue(ExecState* scriptState) const
+RefPtr<JSON::Value> ScriptValue::toInspectorValue(ExecState* scriptState) const
 {
     JSLockHolder holder(scriptState);
-    return jsToInspectorValue(*scriptState, m_value.get(), InspectorValue::maxDepth);
+    return jsToInspectorValue(*scriptState, m_value.get(), JSON::Value::maxDepth);
 }
 
 } // namespace Deprecated
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/bindings/ScriptValue.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/bindings/ScriptValue.h	Fri Jan 05 11:40:42 2018 +0530
@@ -35,14 +35,11 @@
 #include "JSCJSValueInlines.h"
 #include "Strong.h"
 #include "StrongInlines.h"
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
-
-class InspectorValue;
-
-JS_EXPORT_PRIVATE RefPtr<InspectorValue> toInspectorValue(JSC::ExecState&, JSC::JSValue);
-
+JS_EXPORT_PRIVATE RefPtr<JSON::Value> toInspectorValue(JSC::ExecState&, JSC::JSValue);
 }
 
 namespace Deprecated {
@@ -68,7 +65,7 @@
 
     bool operator==(const ScriptValue& other) const { return m_value == other.m_value; }
 
-    RefPtr<Inspector::InspectorValue> toInspectorValue(JSC::ExecState*) const;
+    RefPtr<JSON::Value> toInspectorValue(JSC::ExecState*) const;
 
 private:
     JSC::Strong<JSC::Unknown> m_value;
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h	Fri Jan 05 11:40:42 2018 +0530
@@ -40,6 +40,8 @@
 #include "PutByIdStatus.h"
 #include "StringObject.h"
 
+#include <wtf/CheckedArithmetic.h>
+
 namespace JSC { namespace DFG {
 
 template<typename AbstractStateType>
@@ -1724,12 +1726,15 @@
         JSValue index = forNode(node->child2()).m_value;
         InlineCallFrame* inlineCallFrame = node->child1()->origin.semantic.inlineCallFrame;
 
-        if (index && index.isInt32()) {
+        if (index && index.isUInt32()) {
             // This pretends to return TOP for accesses that are actually proven out-of-bounds because
             // that's the conservative thing to do. Otherwise we'd need to write more code to mark such
             // paths as unreachable, or to return undefined. We could implement that eventually.
 
-            unsigned argumentIndex = index.asUInt32() + node->numberOfArgumentsToSkip();
+            Checked<unsigned, RecordOverflow> argumentIndexChecked = index.asUInt32();
+            argumentIndexChecked += node->numberOfArgumentsToSkip();
+            unsigned argumentIndex;
+            if (argumentIndexChecked.safeGet(argumentIndex) != CheckedState::DidOverflow) {
             if (inlineCallFrame) {
                 if (argumentIndex < inlineCallFrame->arguments.size() - 1) {
                     forNode(node) = m_state.variables().operand(
@@ -1745,6 +1750,7 @@
                 }
             }
         }
+        }
 
         if (inlineCallFrame) {
             // We have a bound on the types even though it's random access. Take advantage of this.
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -246,20 +246,20 @@
                 // If we're out-of-bounds then we proceed only if the prototype chain
                 // for the allocation is sane (i.e. doesn't have indexed properties).
                 JSGlobalObject* globalObject = m_graph.globalObjectFor(edge->origin.semantic);
-                InlineWatchpointSet& objectPrototypeTransition = globalObject->objectPrototype()->structure()->transitionWatchpointSet();
+                Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure();
                 if (edge->op() == CreateRest) {
-                    InlineWatchpointSet& arrayPrototypeTransition = globalObject->arrayPrototype()->structure()->transitionWatchpointSet();
-                    if (arrayPrototypeTransition.isStillValid()
-                        && objectPrototypeTransition.isStillValid()
+                    Structure* arrayPrototypeStructure = globalObject->arrayPrototype()->structure();
+                    if (arrayPrototypeStructure->transitionWatchpointSetIsStillValid()
+                        && objectPrototypeStructure->transitionWatchpointSetIsStillValid()
                         && globalObject->arrayPrototypeChainIsSane()) {
-                        m_graph.watchpoints().addLazily(arrayPrototypeTransition);
-                        m_graph.watchpoints().addLazily(objectPrototypeTransition);
+                        m_graph.registerAndWatchStructureTransition(arrayPrototypeStructure);
+                        m_graph.registerAndWatchStructureTransition(objectPrototypeStructure);
                         break;
                     }
                 } else {
-                    if (objectPrototypeTransition.isStillValid()
+                    if (objectPrototypeStructure->transitionWatchpointSetIsStillValid()
                         && globalObject->objectPrototypeIsSane()) {
-                        m_graph.watchpoints().addLazily(objectPrototypeTransition);
+                        m_graph.registerAndWatchStructureTransition(objectPrototypeStructure);
                         break;
                     }
                 }
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGArrayMode.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGArrayMode.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -214,8 +214,8 @@
             && arrayClass() == Array::OriginalArray
             && globalObject->arrayPrototypeChainIsSane()
             && !graph.hasExitSite(node->origin.semantic, OutOfBounds)) {
-            graph.watchpoints().addLazily(globalObject->arrayPrototype()->structure()->transitionWatchpointSet());
-            graph.watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
+            graph.registerAndWatchStructureTransition(globalObject->arrayPrototype()->structure());
+            graph.registerAndWatchStructureTransition(globalObject->objectPrototype()->structure());
             if (globalObject->arrayPrototypeChainIsSane())
                 return withSpeculation(Array::SaneChain);
         }
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -2319,21 +2319,21 @@
         case Array::Contiguous: {
             JSGlobalObject* globalObject = m_graph.globalObjectFor(currentNodeOrigin().semantic);
 
-            InlineWatchpointSet& objectPrototypeTransition = globalObject->objectPrototype()->structure()->transitionWatchpointSet();
-            InlineWatchpointSet& arrayPrototypeTransition = globalObject->arrayPrototype()->structure()->transitionWatchpointSet();
+            Structure* arrayPrototypeStructure = globalObject->arrayPrototype()->structure();
+            Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure();
 
             // FIXME: We could easily relax the Array/Object.prototype transition as long as we OSR exitted if we saw a hole.
             // https://bugs.webkit.org/show_bug.cgi?id=173171
             if (globalObject->arraySpeciesWatchpoint().state() == IsWatched
                 && globalObject->havingABadTimeWatchpoint()->isStillValid()
-                && arrayPrototypeTransition.isStillValid()
-                && objectPrototypeTransition.isStillValid()
+                && arrayPrototypeStructure->transitionWatchpointSetIsStillValid()
+                && objectPrototypeStructure->transitionWatchpointSetIsStillValid()
                 && globalObject->arrayPrototypeChainIsSane()) {
 
                 m_graph.watchpoints().addLazily(globalObject->arraySpeciesWatchpoint());
                 m_graph.watchpoints().addLazily(globalObject->havingABadTimeWatchpoint());
-                m_graph.watchpoints().addLazily(arrayPrototypeTransition);
-                m_graph.watchpoints().addLazily(objectPrototypeTransition);
+                m_graph.registerAndWatchStructureTransition(arrayPrototypeStructure);
+                m_graph.registerAndWatchStructureTransition(objectPrototypeStructure);
 
                 insertChecks();
 
@@ -2408,19 +2408,19 @@
         case Array::Contiguous: {
             JSGlobalObject* globalObject = m_graph.globalObjectFor(currentNodeOrigin().semantic);
 
-            InlineWatchpointSet& objectPrototypeTransition = globalObject->objectPrototype()->structure()->transitionWatchpointSet();
-            InlineWatchpointSet& arrayPrototypeTransition = globalObject->arrayPrototype()->structure()->transitionWatchpointSet();
+            Structure* arrayPrototypeStructure = globalObject->arrayPrototype()->structure();
+            Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure();
 
             // FIXME: We could easily relax the Array/Object.prototype transition as long as we OSR exitted if we saw a hole.
             // https://bugs.webkit.org/show_bug.cgi?id=173171
             if (globalObject->havingABadTimeWatchpoint()->isStillValid()
-                && arrayPrototypeTransition.isStillValid()
-                && objectPrototypeTransition.isStillValid()
+                && arrayPrototypeStructure->transitionWatchpointSetIsStillValid()
+                && objectPrototypeStructure->transitionWatchpointSetIsStillValid()
                 && globalObject->arrayPrototypeChainIsSane()) {
 
                 m_graph.watchpoints().addLazily(globalObject->havingABadTimeWatchpoint());
-                m_graph.watchpoints().addLazily(arrayPrototypeTransition);
-                m_graph.watchpoints().addLazily(objectPrototypeTransition);
+                m_graph.registerAndWatchStructureTransition(arrayPrototypeStructure);
+                m_graph.registerAndWatchStructureTransition(objectPrototypeStructure);
 
                 insertChecks();
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -760,10 +760,8 @@
                         }
 
                         if (canDoSaneChain) {
-                            m_graph.watchpoints().addLazily(
-                                globalObject->arrayPrototype()->structure()->transitionWatchpointSet());
-                            m_graph.watchpoints().addLazily(
-                                globalObject->objectPrototype()->structure()->transitionWatchpointSet());
+                            m_graph.registerAndWatchStructureTransition(globalObject->arrayPrototype()->structure());
+                            m_graph.registerAndWatchStructureTransition(globalObject->objectPrototype()->structure());
                             if (globalObject->arrayPrototypeChainIsSane())
                                 node->setArrayMode(arrayMode.withSpeculation(Array::SaneChain));
                         }
@@ -1169,16 +1167,16 @@
             // When we go down the fast path, we don't consult the prototype chain, so we must prove
             // that it doesn't contain any indexed properties, and that any holes will result in
             // jsUndefined().
-            InlineWatchpointSet& objectPrototypeTransition = globalObject->objectPrototype()->structure()->transitionWatchpointSet();
-            InlineWatchpointSet& arrayPrototypeTransition = globalObject->arrayPrototype()->structure()->transitionWatchpointSet();
+            Structure* arrayPrototypeStructure = globalObject->arrayPrototype()->structure();
+            Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure();
             if (node->child1()->shouldSpeculateArray()
-                && arrayPrototypeTransition.isStillValid()
-                && objectPrototypeTransition.isStillValid()
+                && arrayPrototypeStructure->transitionWatchpointSetIsStillValid()
+                && objectPrototypeStructure->transitionWatchpointSetIsStillValid()
                 && globalObject->arrayPrototypeChainIsSane()
                 && m_graph.isWatchingArrayIteratorProtocolWatchpoint(node->child1().node())
                 && m_graph.isWatchingHavingABadTimeWatchpoint(node->child1().node())) {
-                m_graph.watchpoints().addLazily(objectPrototypeTransition);
-                m_graph.watchpoints().addLazily(arrayPrototypeTransition);
+                m_graph.registerAndWatchStructureTransition(objectPrototypeStructure);
+                m_graph.registerAndWatchStructureTransition(arrayPrototypeStructure);
                 fixEdge<ArrayUse>(node->child1());
             } else
                 fixEdge<CellUse>(node->child1());
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGGraph.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGGraph.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -1422,6 +1422,12 @@
     return RegisteredStructure::createPrivate(structure);
 }
 
+void Graph::registerAndWatchStructureTransition(Structure* structure)
+{
+    m_plan.weakReferences.addLazily(structure);
+    m_plan.watchpoints.addLazily(structure->transitionWatchpointSet());
+}
+
 void Graph::assertIsRegistered(Structure* structure)
 {
     // It's convenient to be able to call this with a maybe-null structure.
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGGraph.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGGraph.h	Fri Jan 05 11:40:42 2018 +0530
@@ -217,6 +217,7 @@
         return registerStructure(structure, ignored);
     }
     RegisteredStructure registerStructure(Structure*, StructureRegistrationResult&);
+    void registerAndWatchStructureTransition(Structure*);
     void assertIsRegistered(Structure* structure);
 
     // CodeBlock is optional, but may allow additional information to be dumped (e.g. Identifier names).
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -2080,14 +2080,11 @@
             // on a stringPrototypeChainIsSane() guaranteeing that the prototypes have no negative
             // indexed properties either.
             // https://bugs.webkit.org/show_bug.cgi?id=144668
-            m_jit.graph().watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
-            m_jit.graph().watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
+            m_jit.graph().registerAndWatchStructureTransition(globalObject->stringPrototype()->structure());
+            m_jit.graph().registerAndWatchStructureTransition(globalObject->objectPrototype()->structure());
             prototypeChainIsSane = globalObject->stringPrototypeChainIsSane();
         }
         if (prototypeChainIsSane) {
-            m_jit.graph().watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
-            m_jit.graph().watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
-
 #if USE(JSVALUE64)
             addSlowPathGenerator(std::make_unique<SaneStringGetByValSlowPathGenerator>(
                 outOfBounds, this, JSValueRegs(scratchReg), baseReg, propertyReg));
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/dfg/DFGWatchpointCollectionPhase.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -112,10 +112,6 @@
     {
         m_graph.watchpoints().addLazily(set);
     }
-    void addLazily(InlineWatchpointSet& set)
-    {
-        m_graph.watchpoints().addLazily(set);
-    }
 
     JSGlobalObject* globalObject()
     {
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -5443,8 +5443,8 @@
                 // SaneChainOutOfBounds.
                 // https://bugs.webkit.org/show_bug.cgi?id=144668
 
-                m_graph.watchpoints().addLazily(globalObject->stringPrototype()->structure()->transitionWatchpointSet());
-                m_graph.watchpoints().addLazily(globalObject->objectPrototype()->structure()->transitionWatchpointSet());
+                m_graph.registerAndWatchStructureTransition(globalObject->stringPrototype()->structure());
+                m_graph.registerAndWatchStructureTransition(globalObject->objectPrototype()->structure());
 
                 prototypeChainIsSane = globalObject->stringPrototypeChainIsSane();
             }
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "AsyncStackTrace.h"
 
-#include "InspectorValues.h"
 #include "ScriptCallStack.h"
 
 namespace Inspector {
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ConsoleMessage.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ConsoleMessage.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -35,7 +35,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorFrontendDispatchers.h"
-#include "InspectorValues.h"
 #include "ScriptArguments.h"
 #include "ScriptCallFrame.h"
 #include "ScriptCallStack.h"
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ContentSearchUtilities.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "ContentSearchUtilities.h"
 
-#include "InspectorValues.h"
 #include "RegularExpression.h"
 #include "Yarr.h"
 #include "YarrInterpreter.h"
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScript.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScript.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -32,10 +32,10 @@
 #include "config.h"
 #include "InjectedScript.h"
 
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "ScriptFunctionCall.h"
 #include "ScriptObject.h"
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 using Inspector::Protocol::Array;
@@ -98,9 +98,9 @@
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getFunctionDetails"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(functionId);
 
-    RefPtr<InspectorValue> resultValue;
+    RefPtr<JSON::Value> resultValue;
     makeCall(function, &resultValue);
-    if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
+    if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
         if (!resultValue->asString(errorString))
             errorString = ASCIILiteral("Internal error");
         return;
@@ -114,9 +114,9 @@
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("functionDetails"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
 
-    RefPtr<InspectorValue> resultValue;
+    RefPtr<JSON::Value> resultValue;
     makeCall(function, &resultValue);
-    if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
+    if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
         if (!resultValue->asString(errorString))
             errorString = ASCIILiteral("Internal error");
         return;
@@ -130,9 +130,9 @@
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getPreview"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
 
-    RefPtr<InspectorValue> resultValue;
+    RefPtr<JSON::Value> resultValue;
     makeCall(function, &resultValue);
-    if (!resultValue || resultValue->type() != InspectorValue::Type::Object) {
+    if (!resultValue || resultValue->type() != JSON::Value::Type::Object) {
         if (!resultValue->asString(errorString))
             errorString = ASCIILiteral("Internal error");
         return;
@@ -148,9 +148,9 @@
     function.appendArgument(ownProperties);
     function.appendArgument(generatePreview);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -164,9 +164,9 @@
     function.appendArgument(objectId);
     function.appendArgument(generatePreview);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -180,9 +180,9 @@
     function.appendArgument(objectId);
     function.appendArgument(generatePreview);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -199,9 +199,9 @@
     function.appendArgument(startIndex);
     function.appendArgument(numberToFetch);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Array) {
+    if (!result || result->type() != JSON::Value::Type::Array) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -214,9 +214,9 @@
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("saveResult"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(callArgumentJSON);
 
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
-    if (!result || result->type() != InspectorValue::Type::Integer) {
+    if (!result || result->type() != JSON::Value::Type::Integer) {
         errorString = ASCIILiteral("Internal error");
         return;
     }
@@ -237,8 +237,8 @@
     if (!callFramesValue)
         return Array<Inspector::Protocol::Debugger::CallFrame>::create();
     ASSERT(!hadException);
-    RefPtr<InspectorValue> result = toInspectorValue(*scriptState(), callFramesValue);
-    if (result->type() == InspectorValue::Type::Array)
+    RefPtr<JSON::Value> result = toInspectorValue(*scriptState(), callFramesValue);
+    if (result->type() == JSON::Value::Type::Array)
         return BindingTraits<Array<Inspector::Protocol::Debugger::CallFrame>>::runtimeCast(WTFMove(result)).releaseNonNull();
 
     return Array<Inspector::Protocol::Debugger::CallFrame>::create();
@@ -258,7 +258,7 @@
     if (hadException)
         return nullptr;
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
@@ -281,7 +281,7 @@
     if (hadException)
         return nullptr;
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
@@ -299,7 +299,7 @@
     if (hadException)
         return nullptr;
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     bool castSucceeded = toInspectorValue(*scriptState(), r)->asObject(resultObject);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 
@@ -311,7 +311,7 @@
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("setExceptionValue"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
@@ -319,7 +319,7 @@
 {
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("clearExceptionValue"), inspectorEnvironment()->functionCallHandler());
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
@@ -341,7 +341,7 @@
     ASSERT(!hasNoValue());
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("inspectObject"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
@@ -349,7 +349,7 @@
 {
     Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("releaseObject"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
 }
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -33,10 +33,10 @@
 #include "InjectedScriptBase.h"
 
 #include "DebuggerEvalEnabler.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "JSGlobalObject.h"
 #include "ScriptFunctionCall.h"
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -75,10 +75,10 @@
     return function.call(hadException);
 }
 
-void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<InspectorValue>* result)
+void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<JSON::Value>* result)
 {
     if (hasNoValue() || !hasAccessToInspectedScriptState()) {
-        *result = InspectorValue::null();
+        *result = JSON::Value::null();
         return;
     }
 
@@ -89,33 +89,33 @@
     if (!hadException) {
         *result = toInspectorValue(*m_injectedScriptObject.scriptState(), resultValue);
         if (!*result)
-            *result = InspectorValue::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth));
+            *result = JSON::Value::create(String::format("Object has too long reference chain (must not be longer than %d)", JSON::Value::maxDepth));
     } else
-        *result = InspectorValue::create("Exception while making a call.");
+        *result = JSON::Value::create("Exception while making a call.");
 }
 
 void InjectedScriptBase::makeEvalCall(ErrorString& errorString, Deprecated::ScriptFunctionCall& function, RefPtr<Protocol::Runtime::RemoteObject>* objectResult, Protocol::OptOutput<bool>* wasThrown, Protocol::OptOutput<int>* savedResultIndex)
 {
-    RefPtr<InspectorValue> result;
+    RefPtr<JSON::Value> result;
     makeCall(function, &result);
     if (!result) {
         errorString = ASCIILiteral("Internal error: result value is empty");
         return;
     }
 
-    if (result->type() == InspectorValue::Type::String) {
+    if (result->type() == JSON::Value::Type::String) {
         result->asString(errorString);
         ASSERT(errorString.length());
         return;
     }
 
-    RefPtr<InspectorObject> resultTuple;
+    RefPtr<JSON::Object> resultTuple;
     if (!result->asObject(resultTuple)) {
         errorString = ASCIILiteral("Internal error: result is not an Object");
         return;
     }
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     if (!resultTuple->getObject(ASCIILiteral("result"), resultObject)) {
         errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag");
         return;
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptBase.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptBase.h	Fri Jan 05 11:40:42 2018 +0530
@@ -63,7 +63,7 @@
 
     const Deprecated::ScriptObject& injectedScriptObject() const;
     JSC::JSValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const;
-    void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<InspectorValue>* result);
+    void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<JSON::Value>* result);
     void makeEvalCall(ErrorString&, Deprecated::ScriptFunctionCall&, RefPtr<Protocol::Runtime::RemoteObject>* result, Protocol::OptOutput<bool>* wasThrown, Protocol::OptOutput<int>* savedResult = nullptr);
 
 private:
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -35,12 +35,12 @@
 #include "Completion.h"
 #include "InjectedScriptHost.h"
 #include "InjectedScriptSource.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "JSInjectedScriptHost.h"
 #include "JSLock.h"
 #include "ScriptObject.h"
 #include "SourceCode.h"
+#include <wtf/JSONValues.h>
 
 using namespace JSC;
 
@@ -101,11 +101,11 @@
 
 InjectedScript InjectedScriptManager::injectedScriptForObjectId(const String& objectId)
 {
-    RefPtr<InspectorValue> parsedObjectId;
-    if (!InspectorValue::parseJSON(objectId, parsedObjectId))
+    RefPtr<JSON::Value> parsedObjectId;
+    if (!JSON::Value::parseJSON(objectId, parsedObjectId))
         return InjectedScript();
 
-    RefPtr<InspectorObject> resultObject;
+    RefPtr<JSON::Object> resultObject;
     if (!parsedObjectId->asObject(resultObject))
         return InjectedScript();
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -28,11 +28,15 @@
 #include "InspectorBackendDispatcher.h"
 
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
+#include <wtf/JSONValues.h>
 #include <wtf/SetForScope.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
+#if PLATFORM(COCOA)
+#include "DeprecatedInspectorValues.h"
+#endif
+
 namespace Inspector {
 
 SupplementalBackendDispatcher::SupplementalBackendDispatcher(BackendDispatcher& backendDispatcher)
@@ -69,13 +73,13 @@
     m_backendDispatcher->sendPendingErrors();
 }
 
-void BackendDispatcher::CallbackBase::sendSuccess(RefPtr<InspectorObject>&& partialMessage)
+void BackendDispatcher::CallbackBase::sendSuccess(RefPtr<JSON::Object>&& partialMessage)
 {
     if (m_alreadySent)
         return;
 
     m_alreadySent = true;
-    m_backendDispatcher->sendResponse(m_requestId, WTFMove(partialMessage));
+    m_backendDispatcher->sendResponse(m_requestId, WTFMove(partialMessage), false);
 }
 
 BackendDispatcher::BackendDispatcher(Ref<FrontendRouter>&& router)
@@ -109,15 +113,15 @@
     ASSERT(!m_protocolErrors.size());
 
     long requestId = 0;
-    RefPtr<InspectorObject> messageObject;
+    RefPtr<JSON::Object> messageObject;
 
     {
         // In case this is a re-entrant call from a nested run loop, we don't want to lose
         // the outer request's id just because the inner request is bogus.
         SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, std::nullopt);
 
-        RefPtr<InspectorValue> parsedMessage;
-        if (!InspectorValue::parseJSON(message, parsedMessage)) {
+        RefPtr<JSON::Value> parsedMessage;
+        if (!JSON::Value::parseJSON(message, parsedMessage)) {
             reportProtocolError(ParseError, ASCIILiteral("Message must be in JSON format"));
             sendPendingErrors();
             return;
@@ -129,7 +133,7 @@
             return;
         }
 
-        RefPtr<InspectorValue> requestIdValue;
+        RefPtr<JSON::Value> requestIdValue;
         if (!messageObject->getValue(ASCIILiteral("id"), requestIdValue)) {
             reportProtocolError(InvalidRequest, ASCIILiteral("'id' property was not found"));
             sendPendingErrors();
@@ -147,7 +151,7 @@
         // We could be called re-entrantly from a nested run loop, so restore the previous id.
         SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, requestId);
 
-        RefPtr<InspectorValue> methodValue;
+        RefPtr<JSON::Value> methodValue;
         if (!messageObject->getValue(ASCIILiteral("method"), methodValue)) {
             reportProtocolError(InvalidRequest, ASCIILiteral("'method' property wasn't found"));
             sendPendingErrors();
@@ -185,6 +189,8 @@
     }
 }
 
+#if PLATFORM(COCOA)
+// COMPATIBILITY: remove this when no longer needed by system WebInspector.framework <http://webkit.org/b/179847>.
 void BackendDispatcher::sendResponse(long requestId, RefPtr<InspectorObject>&& result)
 {
     ASSERT(!m_protocolErrors.size());
@@ -196,6 +202,25 @@
     responseMessage->setInteger(ASCIILiteral("id"), requestId);
     m_frontendRouter->sendResponse(responseMessage->toJSONString());
 }
+#endif // PLATFORM(COCOA)
+
+// FIXME: remove this function when legacy InspectorObject symbols are no longer needed <http://webkit.org/b/179847>.
+void BackendDispatcher::sendResponse(long requestId, RefPtr<JSON::Object>&& result)
+{
+    sendResponse(requestId, WTFMove(result), false);
+}
+
+void BackendDispatcher::sendResponse(long requestId, RefPtr<JSON::Object>&& result, bool)
+{
+    ASSERT(!m_protocolErrors.size());
+
+    // The JSON-RPC 2.0 specification requires that the "error" member have the value 'null'
+    // if no error occurred during an invocation, but we do not include it at all.
+    Ref<JSON::Object> responseMessage = JSON::Object::create();
+    responseMessage->setObject(ASCIILiteral("result"), WTFMove(result));
+    responseMessage->setInteger(ASCIILiteral("id"), requestId);
+    m_frontendRouter->sendResponse(responseMessage->toJSONString());
+}
 
 void BackendDispatcher::sendPendingErrors()
 {
@@ -214,7 +239,7 @@
     // but only one top-level Error object should be sent per request.
     CommonErrorCode errorCode = InternalError;
     String errorMessage;
-    Ref<InspectorArray> payload = InspectorArray::create();
+    Ref<JSON::Array> payload = JSON::Array::create();
 
     for (auto& data : m_protocolErrors) {
         errorCode = std::get<0>(data);
@@ -223,24 +248,24 @@
         ASSERT_ARG(errorCode, (unsigned)errorCode < WTF_ARRAY_LENGTH(errorCodes));
         ASSERT_ARG(errorCode, errorCodes[errorCode]);
 
-        Ref<InspectorObject> error = InspectorObject::create();
+        Ref<JSON::Object> error = JSON::Object::create();
         error->setInteger(ASCIILiteral("code"), errorCodes[errorCode]);
         error->setString(ASCIILiteral("message"), errorMessage);
         payload->pushObject(WTFMove(error));
     }
 
-    Ref<InspectorObject> topLevelError = InspectorObject::create();
+    Ref<JSON::Object> topLevelError = JSON::Object::create();
     topLevelError->setInteger(ASCIILiteral("code"), errorCodes[errorCode]);
     topLevelError->setString(ASCIILiteral("message"), errorMessage);
     topLevelError->setArray(ASCIILiteral("data"), WTFMove(payload));
 
-    Ref<InspectorObject> message = InspectorObject::create();
+    Ref<JSON::Object> message = JSON::Object::create();
     message->setObject(ASCIILiteral("error"), WTFMove(topLevelError));
     if (m_currentRequestId)
         message->setInteger(ASCIILiteral("id"), m_currentRequestId.value());
     else {
         // The 'null' value for an unknown id is specified in JSON-RPC 2.0, Section 5.
-        message->setValue(ASCIILiteral("id"), InspectorValue::null());
+        message->setValue(ASCIILiteral("id"), JSON::Value::null());
     }
 
     m_frontendRouter->sendResponse(message->toJSONString());
@@ -276,7 +301,7 @@
 #endif
 
 template<typename T>
-T BackendDispatcher::getPropertyValue(InspectorObject* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(InspectorValue&, T&)> asMethod, const char* typeName)
+T BackendDispatcher::getPropertyValue(JSON::Object* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(JSON::Value&, T&)> asMethod, const char* typeName)
 {
     T result(defaultValue);
     // out_optionalValueFound signals to the caller whether an optional property was found.
@@ -308,42 +333,42 @@
     return result;
 }
 
-static bool castToInteger(InspectorValue& value, int& result) { return value.asInteger(result); }
-static bool castToNumber(InspectorValue& value, double& result) { return value.asDouble(result); }
+static bool castToInteger(JSON::Value& value, int& result) { return value.asInteger(result); }
+static bool castToNumber(JSON::Value& value, double& result) { return value.asDouble(result); }
 
-int BackendDispatcher::getInteger(InspectorObject* object, const String& name, bool* valueFound)
+int BackendDispatcher::getInteger(JSON::Object* object, const String& name, bool* valueFound)
 {
     return getPropertyValue<int>(object, name, valueFound, 0, &castToInteger, "Integer");
 }
 
-double BackendDispatcher::getDouble(InspectorObject* object, const String& name, bool* valueFound)
+double BackendDispatcher::getDouble(JSON::Object* object, const String& name, bool* valueFound)
 {
     return getPropertyValue<double>(object, name, valueFound, 0, &castToNumber, "Number");
 }
 
-String BackendDispatcher::getString(InspectorObject* object, const String& name, bool* valueFound)
+String BackendDispatcher::getString(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<String>(object, name, valueFound, "", &InspectorValue::asString, "String");
+    return getPropertyValue<String>(object, name, valueFound, "", &JSON::Value::asString, "String");
 }
 
-bool BackendDispatcher::getBoolean(InspectorObject* object, const String& name, bool* valueFound)
+bool BackendDispatcher::getBoolean(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<bool>(object, name, valueFound, false, &InspectorValue::asBoolean, "Boolean");
+    return getPropertyValue<bool>(object, name, valueFound, false, &JSON::Value::asBoolean, "Boolean");
 }
 
-RefPtr<InspectorObject> BackendDispatcher::getObject(InspectorObject* object, const String& name, bool* valueFound)
+RefPtr<JSON::Object> BackendDispatcher::getObject(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<RefPtr<InspectorObject>>(object, name, valueFound, nullptr, &InspectorValue::asObject, "Object");
+    return getPropertyValue<RefPtr<JSON::Object>>(object, name, valueFound, nullptr, &JSON::Value::asObject, "Object");
 }
 
-RefPtr<InspectorArray> BackendDispatcher::getArray(InspectorObject* object, const String& name, bool* valueFound)
+RefPtr<JSON::Array> BackendDispatcher::getArray(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<RefPtr<InspectorArray>>(object, name, valueFound, nullptr, &InspectorValue::asArray, "Array");
+    return getPropertyValue<RefPtr<JSON::Array>>(object, name, valueFound, nullptr, &JSON::Value::asArray, "Array");
 }
 
-RefPtr<InspectorValue> BackendDispatcher::getValue(InspectorObject* object, const String& name, bool* valueFound)
+RefPtr<JSON::Value> BackendDispatcher::getValue(JSON::Object* object, const String& name, bool* valueFound)
 {
-    return getPropertyValue<RefPtr<InspectorValue>>(object, name, valueFound, nullptr, &InspectorValue::asValue, "Value");
+    return getPropertyValue<RefPtr<JSON::Value>>(object, name, valueFound, nullptr, &JSON::Value::asValue, "Value");
 }
 
 } // namespace Inspector
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h	Fri Jan 05 11:40:42 2018 +0530
@@ -38,13 +38,17 @@
 
 class BackendDispatcher;
 
+#if PLATFORM(COCOA)
+class InspectorObject;
+#endif
+
 typedef String ErrorString;
 
 class JS_EXPORT_PRIVATE SupplementalBackendDispatcher : public RefCounted<SupplementalBackendDispatcher> {
 public:
     SupplementalBackendDispatcher(BackendDispatcher&);
     virtual ~SupplementalBackendDispatcher();
-    virtual void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) = 0;
+    virtual void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) = 0;
 protected:
     Ref<BackendDispatcher> m_backendDispatcher;
 };
@@ -60,7 +64,7 @@
         bool isActive() const;
         void disable() { m_alreadySent = true; }
 
-        void sendSuccess(RefPtr<InspectorObject>&&);
+        void sendSuccess(RefPtr<JSON::Object>&&);
         void sendFailure(const ErrorString&);
 
     private:
@@ -85,7 +89,16 @@
     void registerDispatcherForDomain(const String& domain, SupplementalBackendDispatcher*);
     void dispatch(const String& message);
 
+    // Note that 'unused' is a workaround so the compiler can pick the right sendResponse based on arity.
+    // When <http://webkit.org/b/179847> is fixed or this class is renamed for the JSON::Object case,
+    // then this alternate method with a dummy parameter can be removed in favor of the one without it.
+    void sendResponse(long requestId, RefPtr<JSON::Object>&& result, bool unused);
+#if PLATFORM(COCOA)
+    // COMPATIBILITY: remove this when no longer needed by system WebInspector.framework.
     void sendResponse(long requestId, RefPtr<InspectorObject>&& result);
+#endif
+
+    void sendResponse(long requestId, RefPtr<JSON::Object>&& result);
     void sendPendingErrors();
 
     void reportProtocolError(CommonErrorCode, const String& errorMessage);
@@ -93,15 +106,15 @@
 
     template<typename T>
     WTF_HIDDEN_DECLARATION
-    T getPropertyValue(InspectorObject*, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(InspectorValue&, T&)>, const char* typeName);
+    T getPropertyValue(JSON::Object*, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(JSON::Value&, T&)>, const char* typeName);
 
-    int getInteger(InspectorObject*, const String& name, bool* valueFound);
-    double getDouble(InspectorObject*, const String& name, bool* valueFound);
-    String getString(InspectorObject*, const String& name, bool* valueFound);
-    bool getBoolean(InspectorObject*, const String& name, bool* valueFound);
-    RefPtr<InspectorValue> getValue(InspectorObject*, const String& name, bool* valueFound);
-    RefPtr<InspectorObject> getObject(InspectorObject*, const String& name, bool* valueFound);
-    RefPtr<InspectorArray> getArray(InspectorObject*, const String& name, bool* valueFound);
+    int getInteger(JSON::Object*, const String& name, bool* valueFound);
+    double getDouble(JSON::Object*, const String& name, bool* valueFound);
+    String getString(JSON::Object*, const String& name, bool* valueFound);
+    bool getBoolean(JSON::Object*, const String& name, bool* valueFound);
+    RefPtr<JSON::Value> getValue(JSON::Object*, const String& name, bool* valueFound);
+    RefPtr<JSON::Object> getObject(JSON::Object*, const String& name, bool* valueFound);
+    RefPtr<JSON::Array> getArray(JSON::Object*, const String& name, bool* valueFound);
 
 private:
     BackendDispatcher(Ref<FrontendRouter>&&);
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorFrontendRouter.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorFrontendRouter.h	Fri Jan 05 11:40:42 2018 +0530
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "JSExportMacros.h"
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h	Fri Jan 05 11:40:42 2018 +0530
@@ -26,8 +26,8 @@
 
 #pragma once
 
-#include "InspectorValues.h"
 #include <wtf/Assertions.h>
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -62,14 +62,14 @@
 };
 
 template<typename T>
-class Array : public InspectorArrayBase {
+class Array : public JSON::ArrayBase {
 private:
     Array() { }
 
-    InspectorArray& openAccessors()
+    JSON::Array& openAccessors()
     {
-        COMPILE_ASSERT(sizeof(InspectorArray) == sizeof(Array<T>), cannot_cast);
-        return *static_cast<InspectorArray*>(static_cast<InspectorArrayBase*>(this));
+        COMPILE_ASSERT(sizeof(JSON::Array) == sizeof(Array<T>), cannot_cast);
+        return *static_cast<JSON::Array*>(static_cast<JSON::ArrayBase*>(this));
     }
 
 public:
@@ -104,25 +104,25 @@
     }
 };
 
-// Helper methods for Protocol and other Inspector types are provided by
+// Helper methods for Protocol and other JSON types are provided by
 // specializations of BindingTraits<T>. Some are generated for protocol types.
 
 template<typename T>
 struct BindingTraits {
     typedef T BindingType;
 
-    static void push(InspectorArray&, BindingType&);
-    static InspectorValue::Type typeTag();
-    static RefPtr<T> runtimeCast(RefPtr<InspectorObject>&&);
+    static void push(JSON::Array&, BindingType&);
+    static JSON::Value::Type typeTag();
+    static RefPtr<T> runtimeCast(RefPtr<JSON::Object>&&);
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue*);
+    static void assertValueHasExpectedType(JSON::Value*);
 #endif // !ASSERT_DISABLED
 };
 
-template<InspectorValue::Type TYPE>
+template<JSON::Value::Type TYPE>
 struct PrimitiveBindingTraits {
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue* value)
+    static void assertValueHasExpectedType(JSON::Value* value)
     {
         ASSERT_ARG(value, value && value->type() == TYPE);
     }
@@ -131,24 +131,24 @@
 
 template<typename T>
 struct BindingTraits<Protocol::Array<T>> {
-    static RefPtr<Array<T>> runtimeCast(RefPtr<InspectorValue>&& value)
+    static RefPtr<Array<T>> runtimeCast(RefPtr<JSON::Value>&& value)
     {
         ASSERT_ARG(value, value);
-        RefPtr<InspectorArray> array;
+        RefPtr<JSON::Array> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
 #if !ASSERT_DISABLED
         assertValueHasExpectedType(array.get());
 #endif // !ASSERT_DISABLED
-        COMPILE_ASSERT(sizeof(Array<T>) == sizeof(InspectorArray), type_cast_problem);
-        return static_cast<Array<T>*>(static_cast<InspectorArrayBase*>(array.get()));
+        COMPILE_ASSERT(sizeof(Array<T>) == sizeof(JSON::Array), type_cast_problem);
+        return static_cast<Array<T>*>(static_cast<JSON::ArrayBase*>(array.get()));
     }
 
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue* value)
+    static void assertValueHasExpectedType(JSON::Value* value)
     {
         ASSERT_ARG(value, value);
-        RefPtr<InspectorArray> array;
+        RefPtr<JSON::Array> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
         for (unsigned i = 0; i < array->length(); i++)
@@ -158,20 +158,20 @@
 };
 
 template<>
-struct BindingTraits<InspectorValue> {
+struct BindingTraits<JSON::Value> {
 #if !ASSERT_DISABLED
-    static void assertValueHasExpectedType(InspectorValue*)
+    static void assertValueHasExpectedType(JSON::Value*)
     {
     }
 #endif // !ASSERT_DISABLED
 };
 
-template<> struct BindingTraits<InspectorArray> : public PrimitiveBindingTraits<InspectorValue::Type::Array> { };
-template<> struct BindingTraits<InspectorObject> : public PrimitiveBindingTraits<InspectorValue::Type::Object> { };
-template<> struct BindingTraits<String> : public PrimitiveBindingTraits<InspectorValue::Type::String> { };
-template<> struct BindingTraits<bool> : public PrimitiveBindingTraits<InspectorValue::Type::Boolean> { };
-template<> struct BindingTraits<double> : public PrimitiveBindingTraits<InspectorValue::Type::Double> { };
-template<> struct BindingTraits<int> : public PrimitiveBindingTraits<InspectorValue::Type::Integer> { };
+template<> struct BindingTraits<JSON::Array> : public PrimitiveBindingTraits<JSON::Value::Type::Array> { };
+template<> struct BindingTraits<JSON::Object> : public PrimitiveBindingTraits<JSON::Value::Type::Object> { };
+template<> struct BindingTraits<String> : public PrimitiveBindingTraits<JSON::Value::Type::String> { };
+template<> struct BindingTraits<bool> : public PrimitiveBindingTraits<JSON::Value::Type::Boolean> { };
+template<> struct BindingTraits<double> : public PrimitiveBindingTraits<JSON::Value::Type::Double> { };
+template<> struct BindingTraits<int> : public PrimitiveBindingTraits<JSON::Value::Type::Integer> { };
 
 } // namespace Protocol
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorValues.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,850 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2014 University of Washington. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorValues.h"
-
-#include <wtf/DecimalNumber.h>
-#include <wtf/dtoa.h>
-#include <wtf/text/StringBuilder.h>
-
-namespace Inspector {
-
-namespace {
-
-static const int stackLimit = 1000;
-
-enum Token {
-    OBJECT_BEGIN,
-    OBJECT_END,
-    ARRAY_BEGIN,
-    ARRAY_END,
-    STRING,
-    NUMBER,
-    BOOL_TRUE,
-    BOOL_FALSE,
-    NULL_TOKEN,
-    LIST_SEPARATOR,
-    OBJECT_PAIR_SEPARATOR,
-    INVALID_TOKEN,
-};
-
-const char* const nullString = "null";
-const char* const trueString = "true";
-const char* const falseString = "false";
-
-bool parseConstToken(const UChar* start, const UChar* end, const UChar** tokenEnd, const char* token)
-{
-    while (start < end && *token != '\0' && *start++ == *token++) { }
-
-    if (*token != '\0')
-        return false;
-
-    *tokenEnd = start;
-    return true;
-}
-
-bool readInt(const UChar* start, const UChar* end, const UChar** tokenEnd, bool canHaveLeadingZeros)
-{
-    if (start == end)
-        return false;
-
-    bool haveLeadingZero = '0' == *start;
-    int length = 0;
-    while (start < end && '0' <= *start && *start <= '9') {
-        ++start;
-        ++length;
-    }
-
-    if (!length)
-        return false;
-
-    if (!canHaveLeadingZeros && length > 1 && haveLeadingZero)
-        return false;
-
-    *tokenEnd = start;
-    return true;
-}
-
-bool parseNumberToken(const UChar* start, const UChar* end, const UChar** tokenEnd)
-{
-    // We just grab the number here.  We validate the size in DecodeNumber.
-    // According   to RFC4627, a valid number is: [minus] int [frac] [exp]
-    if (start == end)
-        return false;
-
-    UChar c = *start;
-    if ('-' == c)
-        ++start;
-
-    if (!readInt(start, end, &start, false))
-        return false;
-
-    if (start == end) {
-        *tokenEnd = start;
-        return true;
-    }
-
-    // Optional fraction part
-    c = *start;
-    if ('.' == c) {
-        ++start;
-        if (!readInt(start, end, &start, true))
-            return false;
-        if (start == end) {
-            *tokenEnd = start;
-            return true;
-        }
-        c = *start;
-    }
-
-    // Optional exponent part
-    if ('e' == c || 'E' == c) {
-        ++start;
-        if (start == end)
-            return false;
-        c = *start;
-        if ('-' == c || '+' == c) {
-            ++start;
-            if (start == end)
-                return false;
-        }
-        if (!readInt(start, end, &start, true))
-            return false;
-    }
-
-    *tokenEnd = start;
-    return true;
-}
-
-bool readHexDigits(const UChar* start, const UChar* end, const UChar** tokenEnd, int digits)
-{
-    if (end - start < digits)
-        return false;
-
-    for (int i = 0; i < digits; ++i) {
-        if (!isASCIIHexDigit(*start++))
-            return false;
-    }
-
-    *tokenEnd = start;
-    return true;
-}
-
-bool parseStringToken(const UChar* start, const UChar* end, const UChar** tokenEnd)
-{
-    while (start < end) {
-        UChar c = *start++;
-        if ('\\' == c) {
-            c = *start++;
-            // Make sure the escaped char is valid.
-            switch (c) {
-            case 'x':
-                if (!readHexDigits(start, end, &start, 2))
-                    return false;
-                break;
-            case 'u':
-                if (!readHexDigits(start, end, &start, 4))
-                    return false;
-                break;
-            case '\\':
-            case '/':
-            case 'b':
-            case 'f':
-            case 'n':
-            case 'r':
-            case 't':
-            case 'v':
-            case '"':
-                break;
-            default:
-                return false;
-            }
-        } else if ('"' == c) {
-            *tokenEnd = start;
-            return true;
-        }
-    }
-
-    return false;
-}
-
-Token parseToken(const UChar* start, const UChar* end, const UChar** tokenStart, const UChar** tokenEnd)
-{
-    while (start < end && isSpaceOrNewline(*start))
-        ++start;
-
-    if (start == end)
-        return INVALID_TOKEN;
-
-    *tokenStart = start;
-
-    switch (*start) {
-    case 'n':
-        if (parseConstToken(start, end, tokenEnd, nullString))
-            return NULL_TOKEN;
-        break;
-    case 't':
-        if (parseConstToken(start, end, tokenEnd, trueString))
-            return BOOL_TRUE;
-        break;
-    case 'f':
-        if (parseConstToken(start, end, tokenEnd, falseString))
-            return BOOL_FALSE;
-        break;
-    case '[':
-        *tokenEnd = start + 1;
-        return ARRAY_BEGIN;
-    case ']':
-        *tokenEnd = start + 1;
-        return ARRAY_END;
-    case ',':
-        *tokenEnd = start + 1;
-        return LIST_SEPARATOR;
-    case '{':
-        *tokenEnd = start + 1;
-        return OBJECT_BEGIN;
-    case '}':
-        *tokenEnd = start + 1;
-        return OBJECT_END;
-    case ':':
-        *tokenEnd = start + 1;
-        return OBJECT_PAIR_SEPARATOR;
-    case '0':
-    case '1':
-    case '2':
-    case '3':
-    case '4':
-    case '5':
-    case '6':
-    case '7':
-    case '8':
-    case '9':
-    case '-':
-        if (parseNumberToken(start, end, tokenEnd))
-            return NUMBER;
-        break;
-    case '"':
-        if (parseStringToken(start + 1, end, tokenEnd))
-            return STRING;
-        break;
-    }
-
-    return INVALID_TOKEN;
-}
-
-bool decodeString(const UChar* start, const UChar* end, StringBuilder& output)
-{
-    while (start < end) {
-        UChar c = *start++;
-        if ('\\' != c) {
-            output.append(c);
-            continue;
-        }
-        c = *start++;
-        switch (c) {
-        case '"':
-        case '/':
-        case '\\':
-            break;
-        case 'b':
-            c = '\b';
-            break;
-        case 'f':
-            c = '\f';
-            break;
-        case 'n':
-            c = '\n';
-            break;
-        case 'r':
-            c = '\r';
-            break;
-        case 't':
-            c = '\t';
-            break;
-        case 'v':
-            c = '\v';
-            break;
-        case 'x':
-            c = toASCIIHexValue(start[0], start[1]);
-            start += 2;
-            break;
-        case 'u':
-            c = toASCIIHexValue(start[0], start[1]) << 8 | toASCIIHexValue(start[2], start[3]);
-            start += 4;
-            break;
-        default:
-            return false;
-        }
-        output.append(c);
-    }
-
-    return true;
-}
-
-bool decodeString(const UChar* start, const UChar* end, String& output)
-{
-    if (start == end) {
-        output = emptyString();
-        return true;
-    }
-
-    if (start > end)
-        return false;
-
-    StringBuilder buffer;
-    buffer.reserveCapacity(end - start);
-    if (!decodeString(start, end, buffer))
-        return false;
-
-    output = buffer.toString();
-    return true;
-}
-
-RefPtr<InspectorValue> buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth)
-{
-    if (depth > stackLimit)
-        return nullptr;
-
-    RefPtr<InspectorValue> result;
-    const UChar* tokenStart;
-    const UChar* tokenEnd;
-    Token token = parseToken(start, end, &tokenStart, &tokenEnd);
-    switch (token) {
-    case INVALID_TOKEN:
-        return nullptr;
-    case NULL_TOKEN:
-        result = InspectorValue::null();
-        break;
-    case BOOL_TRUE:
-        result = InspectorValue::create(true);
-        break;
-    case BOOL_FALSE:
-        result = InspectorValue::create(false);
-        break;
-    case NUMBER: {
-        bool ok;
-        double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
-        if (!ok)
-            return nullptr;
-        result = InspectorValue::create(value);
-        break;
-    }
-    case STRING: {
-        String value;
-        bool ok = decodeString(tokenStart + 1, tokenEnd - 1, value);
-        if (!ok)
-            return nullptr;
-        result = InspectorValue::create(value);
-        break;
-    }
-    case ARRAY_BEGIN: {
-        Ref<InspectorArray> array = InspectorArray::create();
-        start = tokenEnd;
-        token = parseToken(start, end, &tokenStart, &tokenEnd);
-        while (token != ARRAY_END) {
-            RefPtr<InspectorValue> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
-            if (!arrayNode)
-                return nullptr;
-            array->pushValue(WTFMove(arrayNode));
-
-            // After a list value, we expect a comma or the end of the list.
-            start = tokenEnd;
-            token = parseToken(start, end, &tokenStart, &tokenEnd);
-            if (token == LIST_SEPARATOR) {
-                start = tokenEnd;
-                token = parseToken(start, end, &tokenStart, &tokenEnd);
-                if (token == ARRAY_END)
-                    return nullptr;
-            } else if (token != ARRAY_END) {
-                // Unexpected value after list value.  Bail out.
-                return nullptr;
-            }
-        }
-        if (token != ARRAY_END)
-            return nullptr;
-        result = WTFMove(array);
-        break;
-    }
-    case OBJECT_BEGIN: {
-        Ref<InspectorObject> object = InspectorObject::create();
-        start = tokenEnd;
-        token = parseToken(start, end, &tokenStart, &tokenEnd);
-        while (token != OBJECT_END) {
-            if (token != STRING)
-                return nullptr;
-            String key;
-            if (!decodeString(tokenStart + 1, tokenEnd - 1, key))
-                return nullptr;
-            start = tokenEnd;
-
-            token = parseToken(start, end, &tokenStart, &tokenEnd);
-            if (token != OBJECT_PAIR_SEPARATOR)
-                return nullptr;
-            start = tokenEnd;
-
-            RefPtr<InspectorValue> value = buildValue(start, end, &tokenEnd, depth + 1);
-            if (!value)
-                return nullptr;
-            object->setValue(key, WTFMove(value));
-            start = tokenEnd;
-
-            // After a key/value pair, we expect a comma or the end of the
-            // object.
-            token = parseToken(start, end, &tokenStart, &tokenEnd);
-            if (token == LIST_SEPARATOR) {
-                start = tokenEnd;
-                token = parseToken(start, end, &tokenStart, &tokenEnd);
-                 if (token == OBJECT_END)
-                    return nullptr;
-            } else if (token != OBJECT_END) {
-                // Unexpected value after last object value.  Bail out.
-                return nullptr;
-            }
-        }
-        if (token != OBJECT_END)
-            return nullptr;
-        result = WTFMove(object);
-        break;
-    }
-
-    default:
-        // We got a token that's not a value.
-        return nullptr;
-    }
-    *valueTokenEnd = tokenEnd;
-    return result;
-}
-
-inline bool escapeChar(UChar c, StringBuilder& dst)
-{
-    switch (c) {
-    case '\b': dst.appendLiteral("\\b"); break;
-    case '\f': dst.appendLiteral("\\f"); break;
-    case '\n': dst.appendLiteral("\\n"); break;
-    case '\r': dst.appendLiteral("\\r"); break;
-    case '\t': dst.appendLiteral("\\t"); break;
-    case '\\': dst.appendLiteral("\\\\"); break;
-    case '"': dst.appendLiteral("\\\""); break;
-    default:
-        return false;
-    }
-    return true;
-}
-
-inline void doubleQuoteString(const String& str, StringBuilder& dst)
-{
-    dst.append('"');
-    for (unsigned i = 0; i < str.length(); ++i) {
-        UChar c = str[i];
-        if (!escapeChar(c, dst)) {
-            if (c < 32 || c > 126 || c == '<' || c == '>') {
-                // 1. Escaping <, > to prevent script execution.
-                // 2. Technically, we could also pass through c > 126 as UTF8, but this
-                //    is also optional.  It would also be a pain to implement here.
-                dst.append(String::format("\\u%04X", c));
-            } else
-                dst.append(c);
-        }
-    }
-    dst.append('"');
-}
-
-} // anonymous namespace
-
-Ref<InspectorValue> InspectorValue::null()
-{
-    return adoptRef(*new InspectorValue);
-}
-
-Ref<InspectorValue> InspectorValue::create(bool value)
-{
-    return adoptRef(*new InspectorValue(value));
-}
-
-Ref<InspectorValue> InspectorValue::create(int value)
-{
-    return adoptRef(*new InspectorValue(value));
-}
-
-Ref<InspectorValue> InspectorValue::create(double value)
-{
-    return adoptRef(*new InspectorValue(value));
-}
-
-Ref<InspectorValue> InspectorValue::create(const String& value)
-{
-    return adoptRef(*new InspectorValue(value));
-}
-
-Ref<InspectorValue> InspectorValue::create(const char* value)
-{
-    return adoptRef(*new InspectorValue(value));
-}
-
-bool InspectorValue::asValue(RefPtr<Inspector::InspectorValue> & value)
-{
-    value = this;
-    return true;
-}
-
-bool InspectorValue::asObject(RefPtr<InspectorObject>&)
-{
-    return false;
-}
-
-bool InspectorValue::asArray(RefPtr<InspectorArray>&)
-{
-    return false;
-}
-
-bool InspectorValue::parseJSON(const String& jsonInput, RefPtr<InspectorValue>& output)
-{
-    // FIXME: This whole file should just use StringView instead of UChar/length and avoid upconverting.
-    auto characters = StringView(jsonInput).upconvertedCharacters();
-    const UChar* start = characters;
-    const UChar* end = start + jsonInput.length();
-    const UChar* tokenEnd;
-    auto result = buildValue(start, end, &tokenEnd, 0);
-    if (!result || tokenEnd != end)
-        return false;
-
-    output = WTFMove(result);
-    return true;
-}
-
-String InspectorValue::toJSONString() const
-{
-    StringBuilder result;
-    result.reserveCapacity(512);
-    writeJSON(result);
-    return result.toString();
-}
-
-bool InspectorValue::asBoolean(bool& output) const
-{
-    if (type() != Type::Boolean)
-        return false;
-
-    output = m_value.boolean;
-    return true;
-}
-
-bool InspectorValue::asDouble(double& output) const
-{
-    if (type() != Type::Double)
-        return false;
-
-    output = m_value.number;
-    return true;
-}
-
-bool InspectorValue::asDouble(float& output) const
-{
-    if (type() != Type::Double)
-        return false;
-
-    output = static_cast<float>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asInteger(int& output) const
-{
-    if (type() != Type::Integer && type() != Type::Double)
-        return false;
-
-    output = static_cast<int>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asInteger(unsigned& output) const
-{
-    if (type() != Type::Integer && type() != Type::Double)
-        return false;
-
-    output = static_cast<unsigned>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asInteger(long& output) const
-{
-    if (type() != Type::Integer && type() != Type::Double)
-        return false;
-
-    output = static_cast<long>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asInteger(long long& output) const
-{
-    if (type() != Type::Integer && type() != Type::Double)
-        return false;
-
-    output = static_cast<long long>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asInteger(unsigned long& output) const
-{
-    if (type() != Type::Integer && type() != Type::Double)
-        return false;
-
-    output = static_cast<unsigned long>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asInteger(unsigned long long& output) const
-{
-    if (type() != Type::Integer && type() != Type::Double)
-        return false;
-
-    output = static_cast<unsigned long long>(m_value.number);
-    return true;
-}
-
-bool InspectorValue::asString(String& output) const
-{
-    if (type() != Type::String)
-        return false;
-
-    output = m_value.string;
-    return true;
-}
-
-void InspectorValue::writeJSON(StringBuilder& output) const
-{
-    switch (m_type) {
-    case Type::Null:
-        output.appendLiteral("null");
-        break;
-    case Type::Boolean:
-        if (m_value.boolean)
-            output.appendLiteral("true");
-        else
-            output.appendLiteral("false");
-        break;
-    case Type::String:
-        doubleQuoteString(m_value.string, output);
-        break;
-    case Type::Double:
-    case Type::Integer: {
-        NumberToLStringBuffer buffer;
-        if (!std::isfinite(m_value.number)) {
-            output.appendLiteral("null");
-            return;
-        }
-        DecimalNumber decimal = m_value.number;
-        unsigned length = 0;
-        if (decimal.bufferLengthForStringDecimal() > WTF::NumberToStringBufferLength) {
-            // Not enough room for decimal. Use exponential format.
-            if (decimal.bufferLengthForStringExponential() > WTF::NumberToStringBufferLength) {
-                // Fallback for an abnormal case if it's too little even for exponential.
-                output.appendLiteral("NaN");
-                return;
-            }
-            length = decimal.toStringExponential(buffer, WTF::NumberToStringBufferLength);
-        } else
-            length = decimal.toStringDecimal(buffer, WTF::NumberToStringBufferLength);
-        output.append(buffer, length);
-        break;
-    }
-    default:
-        ASSERT_NOT_REACHED();
-    }
-}
-
-size_t InspectorValue::memoryCost() const
-{
-    size_t memoryCost = sizeof(this);
-    if (m_type == Type::String && m_value.string)
-        memoryCost += m_value.string->sizeInBytes();
-    return memoryCost;
-}
-
-InspectorObjectBase::~InspectorObjectBase()
-{
-}
-
-bool InspectorObjectBase::asObject(RefPtr<InspectorObject>& output)
-{
-    COMPILE_ASSERT(sizeof(InspectorObject) == sizeof(InspectorObjectBase), cannot_cast);
-
-    output = static_cast<InspectorObject*>(this);
-    return true;
-}
-
-InspectorObject* InspectorObjectBase::openAccessors()
-{
-    COMPILE_ASSERT(sizeof(InspectorObject) == sizeof(InspectorObjectBase), cannot_cast);
-
-    return static_cast<InspectorObject*>(this);
-}
-
-size_t InspectorObjectBase::memoryCost() const
-{
-    size_t memoryCost = InspectorValue::memoryCost();
-    for (const auto& entry : m_map) {
-        memoryCost += entry.key.sizeInBytes();
-        if (entry.value)
-            memoryCost += entry.value->memoryCost();
-    }
-    return memoryCost;
-}
-
-bool InspectorObjectBase::getBoolean(const String& name, bool& output) const
-{
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
-        return false;
-
-    return value->asBoolean(output);
-}
-
-bool InspectorObjectBase::getString(const String& name, String& output) const
-{
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
-        return false;
-
-    return value->asString(output);
-}
-
-bool InspectorObjectBase::getObject(const String& name, RefPtr<InspectorObject>& output) const
-{
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
-        return false;
-
-    return value->asObject(output);
-}
-
-bool InspectorObjectBase::getArray(const String& name, RefPtr<InspectorArray>& output) const
-{
-    RefPtr<InspectorValue> value;
-    if (!getValue(name, value))
-        return false;
-
-    return value->asArray(output);
-}
-
-bool InspectorObjectBase::getValue(const String& name, RefPtr<InspectorValue>& output) const
-{
-    Dictionary::const_iterator findResult = m_map.find(name);
-    if (findResult == m_map.end())
-        return false;
-
-    output = findResult->value;
-    return true;
-}
-
-void InspectorObjectBase::remove(const String& name)
-{
-    m_map.remove(name);
-    m_order.removeFirst(name);
-}
-
-void InspectorObjectBase::writeJSON(StringBuilder& output) const
-{
-    output.append('{');
-    for (size_t i = 0; i < m_order.size(); ++i) {
-        auto findResult = m_map.find(m_order[i]);
-        ASSERT(findResult != m_map.end());
-        if (i)
-            output.append(',');
-        doubleQuoteString(findResult->key, output);
-        output.append(':');
-        findResult->value->writeJSON(output);
-    }
-    output.append('}');
-}
-
-InspectorObjectBase::InspectorObjectBase()
-    : Inspector::InspectorValue(Type::Object)
-    , m_map()
-    , m_order()
-{
-}
-
-InspectorArrayBase::~InspectorArrayBase()
-{
-}
-
-bool InspectorArrayBase::asArray(RefPtr<InspectorArray>& output)
-{
-    COMPILE_ASSERT(sizeof(InspectorArrayBase) == sizeof(InspectorArray), cannot_cast);
-    output = static_cast<InspectorArray*>(this);
-    return true;
-}
-
-void InspectorArrayBase::writeJSON(StringBuilder& output) const
-{
-    output.append('[');
-    for (Vector<RefPtr<InspectorValue>>::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {
-        if (it != m_map.begin())
-            output.append(',');
-        (*it)->writeJSON(output);
-    }
-    output.append(']');
-}
-
-InspectorArrayBase::InspectorArrayBase()
-    : InspectorValue(Type::Array)
-    , m_map()
-{
-}
-
-RefPtr<InspectorValue> InspectorArrayBase::get(size_t index) const
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(index < m_map.size());
-    return m_map[index];
-}
-
-Ref<InspectorObject> InspectorObject::create()
-{
-    return adoptRef(*new InspectorObject);
-}
-
-Ref<InspectorArray> InspectorArray::create()
-{
-    return adoptRef(*new InspectorArray);
-}
-
-size_t InspectorArrayBase::memoryCost() const
-{
-    size_t memoryCost = InspectorValue::memoryCost();
-    for (const auto& item : m_map) {
-        if (item)
-            memoryCost += item->memoryCost();
-    }
-    return memoryCost;
-}
-
-} // namespace Inspector
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/InspectorValues.h	Fri Dec 22 12:50:57 2017 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2014 University of Washington. All rights reserved.
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "JSExportMacros.h"
-#include <wtf/Assertions.h>
-#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-#include <wtf/text/StringHash.h>
-#include <wtf/text/WTFString.h>
-
-namespace Inspector {
-
-class InspectorArray;
-class InspectorArrayBase;
-class InspectorObject;
-class InspectorObjectBase;
-
-class JS_EXPORT_PRIVATE InspectorValue : public RefCounted<InspectorValue> {
-public:
-    static const int maxDepth = 1000;
-
-    virtual ~InspectorValue()
-    {
-        switch (m_type) {
-        case Type::Null:
-        case Type::Boolean:
-        case Type::Double:
-        case Type::Integer:
-            break;
-        case Type::String:
-            if (m_value.string)
-                m_value.string->deref();
-            break;
-        case Type::Object:
-        case Type::Array:
-            break;
-        }
-    }
-
-    static Ref<InspectorValue> null();
-    static Ref<InspectorValue> create(bool);
-    static Ref<InspectorValue> create(int);
-    static Ref<InspectorValue> create(double);
-    static Ref<InspectorValue> create(const String&);
-    static Ref<InspectorValue> create(const char*);
-
-    enum class Type {
-        Null = 0,
-        Boolean,
-        Double,
-        Integer,
-        String,
-        Object,
-        Array,
-    };
-
-    Type type() const { return m_type; }
-    bool isNull() const { return m_type == Type::Null; }
-
-    bool asBoolean(bool&) const;
-    bool asInteger(int&) const;
-    bool asInteger(unsigned&) const;
-    bool asInteger(long&) const;
-    bool asInteger(long long&) const;
-    bool asInteger(unsigned long&) const;
-    bool asInteger(unsigned long long&) const;
-    bool asDouble(double&) const;
-    bool asDouble(float&) const;
-    bool asString(String&) const;
-    bool asValue(RefPtr<InspectorValue>&);
-
-    virtual bool asObject(RefPtr<InspectorObject>&);
-    virtual bool asArray(RefPtr<InspectorArray>&);
-
-    static bool parseJSON(const String& jsonInput, RefPtr<InspectorValue>& output);
-
-    String toJSONString() const;
-    virtual void writeJSON(StringBuilder& output) const;
-
-    virtual size_t memoryCost() const;
-
-protected:
-    InspectorValue()
-        : m_type(Type::Null) { }
-
-    explicit InspectorValue(Type type)
-        : m_type(type) { }
-
-    explicit InspectorValue(bool value)
-        : m_type(Type::Boolean)
-    {
-        m_value.boolean = value;
-    }
-
-    explicit InspectorValue(int value)
-        : m_type(Type::Integer)
-    {
-        m_value.number = static_cast<double>(value);
-    }
-
-    explicit InspectorValue(double value)
-        : m_type(Type::Double)
-    {
-        m_value.number = value;
-    }
-
-    explicit InspectorValue(const String& value)
-        : m_type(Type::String)
-    {
-        m_value.string = value.impl();
-        if (m_value.string)
-            m_value.string->ref();
-    }
-
-    explicit InspectorValue(const char* value)
-        : m_type(Type::String)
-    {
-        String wrapper(value);
-        m_value.string = wrapper.impl();
-        if (m_value.string)
-            m_value.string->ref();
-    }
-
-private:
-    Type m_type { Type::Null };
-    union {
-        bool boolean;
-        double number;
-        StringImpl* string;
-    } m_value;
-};
-
-class JS_EXPORT_PRIVATE InspectorObjectBase : public InspectorValue {
-private:
-    typedef HashMap<String, RefPtr<InspectorValue>> Dictionary;
-
-public:
-    typedef Dictionary::iterator iterator;
-    typedef Dictionary::const_iterator const_iterator;
-
-    InspectorObject* openAccessors();
-
-    size_t memoryCost() const final;
-
-protected:
-    virtual ~InspectorObjectBase();
-
-    bool asObject(RefPtr<InspectorObject>& output) override;
-
-    // FIXME: use templates to reduce the amount of duplicated set*() methods.
-    void setBoolean(const String& name, bool);
-    void setInteger(const String& name, int);
-    void setDouble(const String& name, double);
-    void setString(const String& name, const String&);
-    void setValue(const String& name, RefPtr<InspectorValue>&&);
-    void setObject(const String& name, RefPtr<InspectorObjectBase>&&);
-    void setArray(const String& name, RefPtr<InspectorArrayBase>&&);
-
-    iterator find(const String& name);
-    const_iterator find(const String& name) const;
-
-    // FIXME: use templates to reduce the amount of duplicated get*() methods.
-    bool getBoolean(const String& name, bool& output) const;
-    template<class T> bool getDouble(const String& name, T& output) const
-    {
-        RefPtr<InspectorValue> value;
-        if (!getValue(name, value))
-            return false;
-
-        return value->asDouble(output);
-    }
-    template<class T> bool getInteger(const String& name, T& output) const
-    {
-        RefPtr<InspectorValue> value;
-        if (!getValue(name, value))
-            return false;
-
-        return value->asInteger(output);
-    }
-
-    bool getString(const String& name, String& output) const;
-    bool getObject(const String& name, RefPtr<InspectorObject>&) const;
-    bool getArray(const String& name, RefPtr<InspectorArray>&) const;
-    bool getValue(const String& name, RefPtr<InspectorValue>&) const;
-
-    void remove(const String& name);
-
-    void writeJSON(StringBuilder& output) const override;
-
-    iterator begin() { return m_map.begin(); }
-    iterator end() { return m_map.end(); }
-    const_iterator begin() const { return m_map.begin(); }
-    const_iterator end() const { return m_map.end(); }
-
-    int size() const { return m_map.size(); }
-
-protected:
-    InspectorObjectBase();
-
-private:
-    Dictionary m_map;
-    Vector<String> m_order;
-};
-
-class InspectorObject : public InspectorObjectBase {
-public:
-    static JS_EXPORT_PRIVATE Ref<InspectorObject> create();
-
-    using InspectorObjectBase::asObject;
-
-    // This class expected non-cyclic values, as we cannot serialize cycles in JSON.
-    using InspectorObjectBase::setBoolean;
-    using InspectorObjectBase::setInteger;
-    using InspectorObjectBase::setDouble;
-    using InspectorObjectBase::setString;
-    using InspectorObjectBase::setValue;
-    using InspectorObjectBase::setObject;
-    using InspectorObjectBase::setArray;
-
-    using InspectorObjectBase::find;
-    using InspectorObjectBase::getBoolean;
-    using InspectorObjectBase::getInteger;
-    using InspectorObjectBase::getDouble;
-    using InspectorObjectBase::getString;
-    using InspectorObjectBase::getObject;
-    using InspectorObjectBase::getArray;
-    using InspectorObjectBase::getValue;
-
-    using InspectorObjectBase::remove;
-
-    using InspectorObjectBase::begin;
-    using InspectorObjectBase::end;
-
-    using InspectorObjectBase::size;
-};
-
-
-class JS_EXPORT_PRIVATE InspectorArrayBase : public InspectorValue {
-public:
-    typedef Vector<RefPtr<InspectorValue>>::iterator iterator;
-    typedef Vector<RefPtr<InspectorValue>>::const_iterator const_iterator;
-
-    unsigned length() const { return static_cast<unsigned>(m_map.size()); }
-
-    RefPtr<InspectorValue> get(size_t index) const;
-
-    size_t memoryCost() const final;
-
-protected:
-    virtual ~InspectorArrayBase();
-
-    bool asArray(RefPtr<InspectorArray>&) override;
-
-    void pushBoolean(bool);
-    void pushInteger(int);
-    void pushDouble(double);
-    void pushString(const String&);
-    void pushValue(RefPtr<InspectorValue>&&);
-    void pushObject(RefPtr<InspectorObjectBase>&&);
-    void pushArray(RefPtr<InspectorArrayBase>&&);
-
-    void writeJSON(StringBuilder& output) const override;
-
-    iterator begin() { return m_map.begin(); }
-    iterator end() { return m_map.end(); }
-    const_iterator begin() const { return m_map.begin(); }
-    const_iterator end() const { return m_map.end(); }
-
-protected:
-    InspectorArrayBase();
-
-private:
-    Vector<RefPtr<InspectorValue>> m_map;
-};
-
-class InspectorArray : public InspectorArrayBase {
-public:
-    static JS_EXPORT_PRIVATE Ref<InspectorArray> create();
-
-    using InspectorArrayBase::asArray;
-
-    // This class expected non-cyclic values, as we cannot serialize cycles in JSON.
-    using InspectorArrayBase::pushBoolean;
-    using InspectorArrayBase::pushInteger;
-    using InspectorArrayBase::pushDouble;
-    using InspectorArrayBase::pushString;
-    using InspectorArrayBase::pushValue;
-    using InspectorArrayBase::pushObject;
-    using InspectorArrayBase::pushArray;
-
-    using InspectorArrayBase::get;
-
-    using InspectorArrayBase::begin;
-    using InspectorArrayBase::end;
-};
-
-
-inline InspectorObjectBase::iterator InspectorObjectBase::find(const String& name)
-{
-    return m_map.find(name);
-}
-
-inline InspectorObjectBase::const_iterator InspectorObjectBase::find(const String& name) const
-{
-    return m_map.find(name);
-}
-
-inline void InspectorObjectBase::setBoolean(const String& name, bool value)
-{
-    setValue(name, InspectorValue::create(value));
-}
-
-inline void InspectorObjectBase::setInteger(const String& name, int value)
-{
-    setValue(name, InspectorValue::create(value));
-}
-
-inline void InspectorObjectBase::setDouble(const String& name, double value)
-{
-    setValue(name, InspectorValue::create(value));
-}
-
-inline void InspectorObjectBase::setString(const String& name, const String& value)
-{
-    setValue(name, InspectorValue::create(value));
-}
-
-inline void InspectorObjectBase::setValue(const String& name, RefPtr<InspectorValue>&& value)
-{
-    ASSERT(value);
-    if (m_map.set(name, WTFMove(value)).isNewEntry)
-        m_order.append(name);
-}
-
-inline void InspectorObjectBase::setObject(const String& name, RefPtr<InspectorObjectBase>&& value)
-{
-    ASSERT(value);
-    if (m_map.set(name, WTFMove(value)).isNewEntry)
-        m_order.append(name);
-}
-
-inline void InspectorObjectBase::setArray(const String& name, RefPtr<InspectorArrayBase>&& value)
-{
-    ASSERT(value);
-    if (m_map.set(name, WTFMove(value)).isNewEntry)
-        m_order.append(name);
-}
-
-inline void InspectorArrayBase::pushBoolean(bool value)
-{
-    m_map.append(InspectorValue::create(value));
-}
-
-inline void InspectorArrayBase::pushInteger(int value)
-{
-    m_map.append(InspectorValue::create(value));
-}
-
-inline void InspectorArrayBase::pushDouble(double value)
-{
-    m_map.append(InspectorValue::create(value));
-}
-
-inline void InspectorArrayBase::pushString(const String& value)
-{
-    m_map.append(InspectorValue::create(value));
-}
-
-inline void InspectorArrayBase::pushValue(RefPtr<InspectorValue>&& value)
-{
-    ASSERT(value);
-    m_map.append(WTFMove(value));
-}
-
-inline void InspectorArrayBase::pushObject(RefPtr<InspectorObjectBase>&& value)
-{
-    ASSERT(value);
-    m_map.append(WTFMove(value));
-}
-
-inline void InspectorArrayBase::pushArray(RefPtr<InspectorArrayBase>&& value)
-{
-    ASSERT(value);
-    m_map.append(WTFMove(value));
-}
-
-} // namespace Inspector
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ScriptCallFrame.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ScriptCallFrame.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -32,8 +32,6 @@
 #include "config.h"
 #include "ScriptCallFrame.h"
 
-#include "InspectorValues.h"
-
 namespace Inspector {
 
 ScriptCallFrame::ScriptCallFrame(const String& functionName, const String& scriptName, JSC::SourceID sourceID, unsigned lineNumber, unsigned column)
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ScriptCallStack.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/ScriptCallStack.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -32,8 +32,6 @@
 #include "config.h"
 #include "ScriptCallStack.h"
 
-#include "InspectorValues.h"
-
 namespace Inspector {
 
 Ref<ScriptCallStack> ScriptCallStack::create()
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -33,8 +33,8 @@
 
 #include "InspectorEnvironment.h"
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
 #include "ScriptValue.h"
+#include <wtf/JSONValues.h>
 
 namespace Inspector {
 
@@ -90,7 +90,7 @@
     m_environment.frontendInitialized();
 }
 
-void InspectorAgent::inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints)
+void InspectorAgent::inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<JSON::Object>&& hints)
 {
     if (m_enabled) {
         m_frontendDispatcher->inspect(objectToInspect, hints);
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -39,7 +39,6 @@
 
 class BackendDispatcher;
 class InspectorEnvironment;
-class InspectorObject;
 
 typedef String ErrorString;
 
@@ -57,7 +56,7 @@
     void disable(ErrorString&) override;
     void initialized(ErrorString&) override;
 
-    void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints);
+    void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<JSON::Object>&& hints);
     void evaluateForTestInFrontend(const String& script);
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
@@ -71,7 +70,7 @@
     Ref<InspectorBackendDispatcher> m_backendDispatcher;
 
     Vector<String> m_pendingEvaluateTestCommands;
-    std::pair<RefPtr<Protocol::Runtime::RemoteObject>, RefPtr<InspectorObject>> m_pendingInspectData;
+    std::pair<RefPtr<Protocol::Runtime::RemoteObject>, RefPtr<JSON::Object>> m_pendingInspectData;
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     RefPtr<Inspector::Protocol::Array<String>> m_pendingExtraDomainsData;
 #endif
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -35,7 +35,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
 #include "JSCInlines.h"
 #include "RegularExpression.h"
 #include "ScriptCallStack.h"
@@ -43,6 +42,7 @@
 #include "ScriptDebugServer.h"
 #include "ScriptObject.h"
 #include "ScriptValue.h"
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/Stopwatch.h>
 #include <wtf/text/WTFString.h>
@@ -172,7 +172,7 @@
     m_scriptDebugServer.setSuppressAllPauses(suppress);
 }
 
-static RefPtr<InspectorObject> buildAssertPauseReason(const String& message)
+static RefPtr<JSON::Object> buildAssertPauseReason(const String& message)
 {
     auto reason = Inspector::Protocol::Debugger::AssertPauseReason::create().release();
     if (!message.isNull())
@@ -180,7 +180,7 @@
     return reason->openAccessors();
 }
 
-static RefPtr<InspectorObject> buildCSPViolationPauseReason(const String& directiveText)
+static RefPtr<JSON::Object> buildCSPViolationPauseReason(const String& directiveText)
 {
     auto reason = Inspector::Protocol::Debugger::CSPViolationPauseReason::create()
         .setDirective(directiveText)
@@ -188,7 +188,7 @@
     return reason->openAccessors();
 }
 
-RefPtr<InspectorObject> InspectorDebuggerAgent::buildBreakpointPauseReason(JSC::BreakpointID debuggerBreakpointIdentifier)
+RefPtr<JSON::Object> InspectorDebuggerAgent::buildBreakpointPauseReason(JSC::BreakpointID debuggerBreakpointIdentifier)
 {
     ASSERT(debuggerBreakpointIdentifier != JSC::noBreakpointID);
     auto it = m_debuggerBreakpointIdentifierToInspectorBreakpointIdentifier.find(debuggerBreakpointIdentifier);
@@ -201,7 +201,7 @@
     return reason->openAccessors();
 }
 
-RefPtr<InspectorObject> InspectorDebuggerAgent::buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript& injectedScript)
+RefPtr<JSON::Object> InspectorDebuggerAgent::buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript& injectedScript)
 {
     ASSERT(exception);
     if (!exception)
@@ -315,9 +315,9 @@
         m_pendingAsyncCalls.remove(identifier);
 }
 
-static Ref<InspectorObject> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<InspectorArray>& actions, bool isRegex, bool autoContinue, unsigned ignoreCount)
+static Ref<JSON::Object> buildObjectForBreakpointCookie(const String& url, int lineNumber, int columnNumber, const String& condition, RefPtr<JSON::Array>& actions, bool isRegex, bool autoContinue, unsigned ignoreCount)
 {
-    Ref<InspectorObject> breakpointObject = InspectorObject::create();
+    Ref<JSON::Object> breakpointObject = JSON::Object::create();
     breakpointObject->setString(ASCIILiteral("url"), url);
     breakpointObject->setInteger(ASCIILiteral("lineNumber"), lineNumber);
     breakpointObject->setInteger(ASCIILiteral("columnNumber"), columnNumber);
@@ -363,7 +363,7 @@
     return false;
 }
 
-bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString& errorString, RefPtr<InspectorArray>& actions, BreakpointActions* result)
+bool InspectorDebuggerAgent::breakpointActionsFromProtocol(ErrorString& errorString, RefPtr<JSON::Array>& actions, BreakpointActions* result)
 {
     if (!actions)
         return true;
@@ -374,8 +374,8 @@
 
     result->reserveCapacity(actionsLength);
     for (unsigned i = 0; i < actionsLength; ++i) {
-        RefPtr<InspectorValue> value = actions->get(i);
-        RefPtr<InspectorObject> object;
+        RefPtr<JSON::Value> value = actions->get(i);
+        RefPtr<JSON::Object> object;
         if (!value->asObject(object)) {
             errorString = ASCIILiteral("BreakpointAction of incorrect type, expected object");
             return false;
@@ -420,7 +420,7 @@
     return WTFMove(location);
 }
 
-static bool parseLocation(ErrorString& errorString, const InspectorObject& location, JSC::SourceID& sourceID, unsigned& lineNumber, unsigned& columnNumber)
+static bool parseLocation(ErrorString& errorString, const JSON::Object& location, JSC::SourceID& sourceID, unsigned& lineNumber, unsigned& columnNumber)
 {
     String scriptIDStr;
     if (!location.getString(ASCIILiteral("scriptId"), scriptIDStr) || !location.getInteger(ASCIILiteral("lineNumber"), lineNumber)) {
@@ -435,7 +435,7 @@
     return true;
 }
 
-void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations)
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString& errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations)
 {
     locations = Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>::create();
     if (!optionalURL == !optionalURLRegex) {
@@ -456,7 +456,7 @@
     String condition = emptyString();
     bool autoContinue = false;
     unsigned ignoreCount = 0;
-    RefPtr<InspectorArray> actions;
+    RefPtr<JSON::Array> actions;
     if (options) {
         options->getString(ASCIILiteral("condition"), condition);
         options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
@@ -496,7 +496,7 @@
     *outBreakpointIdentifier = breakpointIdentifier;
 }
 
-void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const InspectorObject& location, const InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation)
+void InspectorDebuggerAgent::setBreakpoint(ErrorString& errorString, const JSON::Object& location, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId* outBreakpointIdentifier, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation)
 {
     JSC::SourceID sourceID;
     unsigned lineNumber;
@@ -507,7 +507,7 @@
     String condition = emptyString();
     bool autoContinue = false;
     unsigned ignoreCount = 0;
-    RefPtr<InspectorArray> actions;
+    RefPtr<JSON::Array> actions;
     if (options) {
         options->getString(ASCIILiteral("condition"), condition);
         options->getBoolean(ASCIILiteral("autoContinue"), autoContinue);
@@ -604,7 +604,7 @@
     registerIdleHandler();
 }
 
-void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const InspectorObject& location)
+void InspectorDebuggerAgent::continueToLocation(ErrorString& errorString, const JSON::Object& location)
 {
     if (!assertPaused(errorString))
         return;
@@ -695,7 +695,7 @@
     injectedScript.getFunctionDetails(errorString, functionId, &details);
 }
 
-void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data)
+void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data)
 {
     if (m_javaScriptPauseScheduled)
         return;
@@ -909,7 +909,7 @@
         return;
 
     for (auto& entry : m_javaScriptBreakpoints) {
-        RefPtr<InspectorObject> breakpointObject = entry.value;
+        RefPtr<JSON::Object> breakpointObject = entry.value;
 
         bool isRegex;
         String url;
@@ -925,7 +925,7 @@
         breakpointObject->getBoolean(ASCIILiteral("autoContinue"), scriptBreakpoint.autoContinue);
         breakpointObject->getInteger(ASCIILiteral("ignoreCount"), scriptBreakpoint.ignoreCount);
         ErrorString errorString;
-        RefPtr<InspectorArray> actions;
+        RefPtr<JSON::Array> actions;
         breakpointObject->getArray(ASCIILiteral("actions"), actions);
         if (!breakpointActionsFromProtocol(errorString, actions, &scriptBreakpoint.actions)) {
             ASSERT_NOT_REACHED();
@@ -1061,7 +1061,7 @@
         m_frontendDispatcher->resumed();
 }
 
-void InspectorDebuggerAgent::breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data)
+void InspectorDebuggerAgent::breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data)
 {
     m_breakReason = breakReason;
     m_breakAuxData = WTFMove(data);
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -46,8 +46,6 @@
 class AsyncStackTrace;
 class InjectedScript;
 class InjectedScriptManager;
-class InspectorArray;
-class InspectorObject;
 class ScriptDebugServer;
 typedef String ErrorString;
 
@@ -66,11 +64,11 @@
     void disable(ErrorString&) final;
     void setAsyncStackTraceDepth(ErrorString&, int depth) final;
     void setBreakpointsActive(ErrorString&, bool active) final;
-    void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final;
-    void setBreakpoint(ErrorString&, const Inspector::InspectorObject& location, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation) final;
+    void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final;
+    void setBreakpoint(ErrorString&, const JSON::Object& location, const JSON::Object* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Debugger::Location>& actualLocation) final;
     void removeBreakpoint(ErrorString&, const String& breakpointIdentifier) final;
     void continueUntilNextRunLoop(ErrorString&) final;
-    void continueToLocation(ErrorString&, const InspectorObject& location) final;
+    void continueToLocation(ErrorString&, const JSON::Object& location) final;
     void searchInContent(ErrorString&, const String& scriptID, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) final;
     void getScriptSource(ErrorString&, const String& scriptID, String* scriptSource) final;
     void getFunctionDetails(ErrorString&, const String& functionId, RefPtr<Inspector::Protocol::Debugger::FunctionDetails>&) final;
@@ -102,11 +100,11 @@
     void willDispatchAsyncCall(AsyncCallType, int callbackId);
     void didDispatchAsyncCall();
 
-    void schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);
+    void schedulePauseOnNextStatement(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data);
     void cancelPauseOnNextStatement();
     bool pauseOnNextStatementEnabled() const { return m_javaScriptPauseScheduled; }
 
-    void breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<InspectorObject>&& data);
+    void breakProgram(DebuggerFrontendDispatcher::Reason breakReason, RefPtr<JSON::Object>&& data);
     void scriptExecutionBlockedByCSP(const String& directiveText);
 
     class Listener {
@@ -163,17 +161,17 @@
     void willStepAndMayBecomeIdle();
     void didBecomeIdle();
 
-    RefPtr<InspectorObject> buildBreakpointPauseReason(JSC::BreakpointID);
-    RefPtr<InspectorObject> buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript&);
+    RefPtr<JSON::Object> buildBreakpointPauseReason(JSC::BreakpointID);
+    RefPtr<JSON::Object> buildExceptionPauseReason(JSC::JSValue exception, const InjectedScript&);
 
-    bool breakpointActionsFromProtocol(ErrorString&, RefPtr<InspectorArray>& actions, BreakpointActions* result);
+    bool breakpointActionsFromProtocol(ErrorString&, RefPtr<JSON::Array>& actions, BreakpointActions* result);
 
     typedef std::pair<unsigned, int> AsyncCallIdentifier;
     static AsyncCallIdentifier asyncCallIdentifier(AsyncCallType, int callbackId);
 
     typedef HashMap<JSC::SourceID, Script> ScriptsMap;
     typedef HashMap<String, Vector<JSC::BreakpointID>> BreakpointIdentifierToDebugServerBreakpointIDsMap;
-    typedef HashMap<String, RefPtr<InspectorObject>> BreakpointIdentifierToBreakpointMap;
+    typedef HashMap<String, RefPtr<JSON::Object>> BreakpointIdentifierToBreakpointMap;
     typedef HashMap<JSC::BreakpointID, String> DebugServerBreakpointIDToBreakpointIdentifier;
 
     InjectedScriptManager& m_injectedScriptManager;
@@ -189,7 +187,7 @@
     DebugServerBreakpointIDToBreakpointIdentifier m_debuggerBreakpointIdentifierToInspectorBreakpointIdentifier;
     JSC::BreakpointID m_continueToLocationBreakpointID;
     DebuggerFrontendDispatcher::Reason m_breakReason;
-    RefPtr<InspectorObject> m_breakAuxData;
+    RefPtr<JSON::Object> m_breakAuxData;
     ShouldDispatchResumed m_conditionToDispatchResumed { ShouldDispatchResumed::No };
     bool m_enablePauseWhenIdle { false };
     HashMap<AsyncCallIdentifier, RefPtr<AsyncStackTrace>> m_pendingAsyncCalls;
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -38,7 +38,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "InspectorFrontendRouter.h"
-#include "InspectorValues.h"
 #include "JSLock.h"
 #include "ParserError.h"
 #include "ScriptDebugServer.h"
@@ -46,6 +45,7 @@
 #include "TypeProfiler.h"
 #include "TypeProfilerLog.h"
 #include <wtf/CurrentTime.h>
+#include <wtf/JSONValues.h>
 
 using namespace JSC;
 
@@ -132,7 +132,7 @@
     }
 }
 
-void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const InspectorArray* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
+void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
 {
     InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
     if (injectedScript.hasNoValue()) {
@@ -225,7 +225,7 @@
     injectedScript.getCollectionEntries(errorString, objectId, objectGroup ? *objectGroup : String(), start, fetch, &entries);
 }
 
-void InspectorRuntimeAgent::saveResult(ErrorString& errorString, const Inspector::InspectorObject& callArgument, const int* executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex)
+void InspectorRuntimeAgent::saveResult(ErrorString& errorString, const JSON::Object& callArgument, const int* executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex)
 {
     InjectedScript injectedScript;
 
@@ -257,7 +257,7 @@
     m_injectedScriptManager.releaseObjectGroup(objectGroup);
 }
 
-void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& errorString, const Inspector::InspectorArray& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>& typeDescriptions)
+void InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets(ErrorString& errorString, const JSON::Array& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>& typeDescriptions)
 {
     static const bool verbose = false;
 
@@ -271,8 +271,8 @@
     m_vm.typeProfilerLog()->processLogEntries(ASCIILiteral("User Query"));
 
     for (size_t i = 0; i < locations.length(); i++) {
-        RefPtr<Inspector::InspectorValue> value = locations.get(i);
-        RefPtr<InspectorObject> location;
+        RefPtr<JSON::Value> value = locations.get(i);
+        RefPtr<JSON::Object> location;
         if (!value->asObject(location)) {
             errorString = ASCIILiteral("Array of TypeLocation objects has an object that does not have type of TypeLocation.");
             return;
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -44,7 +44,6 @@
 
 class InjectedScript;
 class InjectedScriptManager;
-class InspectorArray;
 class ScriptDebugServer;
 typedef String ErrorString;
 
@@ -59,15 +58,15 @@
     void disable(ErrorString&) override { m_enabled = false; }
     void parse(ErrorString&, const String& expression, Inspector::Protocol::Runtime::SyntaxErrorType* result, Inspector::Protocol::OptOutput<String>* message, RefPtr<Inspector::Protocol::Runtime::ErrorRange>&) final;
     void evaluate(ErrorString&, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const int* const executionContextId, const bool* const returnByValue, const bool* const generatePreview, const bool* const saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
-    void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const Inspector::InspectorArray* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* const generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) final;
+    void callFunctionOn(ErrorString&, const String& objectId, const String& expression, const JSON::Array* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* const generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown) final;
     void releaseObject(ErrorString&, const ErrorString& objectId) final;
     void getPreview(ErrorString&, const String& objectId, RefPtr<Inspector::Protocol::Runtime::ObjectPreview>&) final;
     void getProperties(ErrorString&, const String& objectId, const bool* const ownProperties, const bool* const generatePreview, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) final;
     void getDisplayableProperties(ErrorString&, const String& objectId, const bool* const generatePreview, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties) final;
     void getCollectionEntries(ErrorString&, const String& objectId, const String* const objectGroup, const int* const startIndex, const int* const numberToFetch, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::CollectionEntry>>& entries) final;
-    void saveResult(ErrorString&, const Inspector::InspectorObject& callArgument, const int* const executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
+    void saveResult(ErrorString&, const JSON::Object& callArgument, const int* const executionContextId, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
     void releaseObjectGroup(ErrorString&, const String& objectGroup) final;
-    void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const Inspector::InspectorArray& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
+    void getRuntimeTypesForVariablesAtOffsets(ErrorString&, const JSON::Array& locations, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::TypeDescription>>&) override;
     void enableTypeProfiler(ErrorString&) override;
     void disableTypeProfiler(ErrorString&) override;
     void enableControlFlowProfiler(ErrorString&) override;
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py	Fri Jan 05 11:40:42 2018 +0530
@@ -38,9 +38,9 @@
     'integer': 'int',
     'number': 'double',
     'string': 'String',
-    'object': 'Inspector::InspectorObject',
-    'array': 'Inspector::InspectorArray',
-    'any': 'Inspector::InspectorValue'
+    'object': 'JSON::Object',
+    'array': 'JSON::Array',
+    'any': 'JSON::Value'
 }
 
 class CppGenerator(Generator):
@@ -98,7 +98,7 @@
     @staticmethod
     def cpp_protocol_type_for_type(_type):
         if isinstance(_type, ObjectType) and len(_type.members) == 0:
-            return 'Inspector::InspectorObject'
+            return 'JSON::Object'
         if isinstance(_type, ArrayType):
             if _type.raw_name() is None:  # Otherwise, fall through and use typedef'd name.
                 return 'Inspector::Protocol::Array<%s>' % CppGenerator.cpp_protocol_type_for_type(_type.element_type)
@@ -125,13 +125,13 @@
 
         # This handles the 'any' type and objects with defined properties.
         if isinstance(_type, ObjectType) or _type.qualified_name() is 'object':
-            cpp_name = 'Inspector::InspectorObject'
+            cpp_name = 'JSON::Object'
             if parameter.is_optional:
                 return 'const %s*' % cpp_name
             else:
                 return 'const %s&' % cpp_name
         if isinstance(_type, ArrayType):
-            cpp_name = 'Inspector::InspectorArray'
+            cpp_name = 'JSON::Array'
             if parameter.is_optional:
                 return 'const %s*' % cpp_name
             else:
@@ -172,9 +172,9 @@
         if isinstance(_type, PrimitiveType):
             cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
             if _type.qualified_name() in ['object']:
-                return 'RefPtr<Inspector::InspectorObject>'
+                return 'RefPtr<JSON::Object>'
             elif _type.qualified_name() in ['any']:
-                return 'RefPtr<Inspector::InspectorValue>'
+                return 'RefPtr<JSON::Value>'
             elif is_optional:
                 return 'const %s* const' % cpp_name
             elif _type.qualified_name() in ['string']:
@@ -254,9 +254,9 @@
             _type = _type.primitive_type  # Fall through.
 
         if isinstance(_type, ObjectType):
-            return "RefPtr<Inspector::InspectorObject>"
+            return "RefPtr<JSON::Object>"
         if isinstance(_type, ArrayType):
-            return "RefPtr<Inspector::InspectorArray>"
+            return "RefPtr<JSON::Array>"
         if isinstance(_type, PrimitiveType):
             cpp_name = CppGenerator.cpp_name_for_primitive_type(_type)
             if _type.qualified_name() in ['any', 'object']:
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py	Fri Jan 05 11:40:42 2018 +0530
@@ -95,7 +95,7 @@
     """${classAndExportMacro} ${domainName}BackendDispatcher final : public SupplementalBackendDispatcher {
 public:
     static Ref<${domainName}BackendDispatcher> create(BackendDispatcher&, ${domainName}BackendDispatcherHandler*);
-    void dispatch(long requestId, const String& method, Ref<InspectorObject>&& message) override;
+    void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 ${commandDeclarations}
 private:
     ${domainName}BackendDispatcher(BackendDispatcher&, ${domainName}BackendDispatcherHandler*);
@@ -119,11 +119,11 @@
     virtual void ${commandName}(${inParameters}) = 0;""")
 
     BackendDispatcherImplementationSmallSwitch = (
-    """void ${domainName}BackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message)
+    """void ${domainName}BackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
 {
     Ref<${domainName}BackendDispatcher> protect(*this);
 
-    RefPtr<InspectorObject> parameters;
+    RefPtr<JSON::Object> parameters;
     message->getObject(ASCIILiteral("params"), parameters);
 
 ${dispatchCases}
@@ -132,14 +132,14 @@
 }""")
 
     BackendDispatcherImplementationLargeSwitch = (
-"""void ${domainName}BackendDispatcher::dispatch(long requestId, const String& method, Ref<InspectorObject>&& message)
+"""void ${domainName}BackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
 {
     Ref<${domainName}BackendDispatcher> protect(*this);
 
-    RefPtr<InspectorObject> parameters;
+    RefPtr<JSON::Object> parameters;
     message->getObject(ASCIILiteral("params"), parameters);
 
-    typedef void (${domainName}BackendDispatcher::*CallHandler)(long requestId, RefPtr<InspectorObject>&& message);
+    typedef void (${domainName}BackendDispatcher::*CallHandler)(long requestId, RefPtr<JSON::Object>&& message);
     typedef HashMap<String, CallHandler> DispatchMap;
     static NeverDestroyed<DispatchMap> dispatchMap;
     if (dispatchMap.get().isEmpty()) {
@@ -189,7 +189,7 @@
 
 void ${domainName}BackendDispatcherHandler::${callbackName}::sendSuccess(${formalParameters})
 {
-    Ref<InspectorObject> jsonMessage = InspectorObject::create();
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
 ${outParameterAssignments}
     CallbackBase::sendSuccess(WTFMove(jsonMessage));
 }""")
@@ -207,14 +207,14 @@
 """    template<int STATE>
     class Builder {
     private:
-        RefPtr<InspectorObject> m_result;
+        RefPtr<JSON::Object> m_result;
 
         template<int STEP> Builder<STATE | STEP>& castState()
         {
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(Ref</*${objectType}*/InspectorObject>&& object)
+        Builder(Ref</*${objectType}*/JSON::Object>&& object)
             : m_result(WTFMove(object))
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
@@ -227,9 +227,9 @@
         Ref<${objectType}> release()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
-            COMPILE_ASSERT(sizeof(${objectType}) == sizeof(InspectorObject), cannot_cast);
+            COMPILE_ASSERT(sizeof(${objectType}) == sizeof(JSON::Object), cannot_cast);
 
-            Ref<InspectorObject> result = m_result.releaseNonNull();
+            Ref<JSON::Object> result = m_result.releaseNonNull();
             return WTFMove(*reinterpret_cast<Ref<${objectType}>*>(&result));
         }
     };
@@ -240,19 +240,19 @@
      */
     static Builder<NoFieldsSet> create()
     {
-        return Builder<NoFieldsSet>(InspectorObject::create());
+        return Builder<NoFieldsSet>(JSON::Object::create());
     }""")
 
     ProtocolObjectRuntimeCast = (
-"""RefPtr<${objectType}> BindingTraits<${objectType}>::runtimeCast(RefPtr<InspectorValue>&& value)
+"""RefPtr<${objectType}> BindingTraits<${objectType}>::runtimeCast(RefPtr<JSON::Value>&& value)
 {
-    RefPtr<InspectorObject> result;
+    RefPtr<JSON::Object> result;
     bool castSucceeded = value->asObject(result);
     ASSERT_UNUSED(castSucceeded, castSucceeded);
 #if !ASSERT_DISABLED
     BindingTraits<${objectType}>::assertValueHasExpectedType(result.get());
 #endif  // !ASSERT_DISABLED
-    COMPILE_ASSERT(sizeof(${objectType}) == sizeof(InspectorObjectBase), type_cast_problem);
-    return static_cast<${objectType}*>(static_cast<InspectorObjectBase*>(result.get()));
+    COMPILE_ASSERT(sizeof(${objectType}) == sizeof(JSON::ObjectBase), type_cast_problem);
+    return static_cast<${objectType}*>(static_cast<JSON::ObjectBase*>(result.get()));
 }
 """)
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py	Fri Jan 05 11:40:42 2018 +0530
@@ -214,4 +214,4 @@
         return self.wrap_with_guard_for_domain(domain, Template(CppTemplates.BackendDispatcherHeaderDomainDispatcherDeclaration).substitute(None, **handler_args))
 
     def _generate_dispatcher_declaration_for_command(self, command):
-        return "    void %s(long requestId, RefPtr<InspectorObject>&& parameters);" % command.command_name
+        return "    void %s(long requestId, RefPtr<JSON::Object>&& parameters);" % command.command_name
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py	Fri Jan 05 11:40:42 2018 +0530
@@ -50,7 +50,7 @@
     def generate_output(self):
         secondary_headers = [
             '<inspector/InspectorFrontendRouter.h>',
-            '<inspector/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
             '<wtf/NeverDestroyed.h>',
             '<wtf/text/CString.h>']
 
@@ -277,9 +277,9 @@
 
         lines = []
         if len(command.call_parameters) == 0:
-            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<InspectorObject>&&)' % command_args)
+            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<JSON::Object>&&)' % command_args)
         else:
-            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<InspectorObject>&& parameters)' % command_args)
+            lines.append('void %(domainName)sBackendDispatcher::%(commandName)s(long requestId, RefPtr<JSON::Object>&& parameters)' % command_args)
         lines.append('{')
 
         if len(command.call_parameters) > 0:
@@ -295,7 +295,7 @@
             lines.append('')
 
         lines.append('    ErrorString error;')
-        lines.append('    Ref<InspectorObject> result = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> result = JSON::Object::create();')
         if command.is_async:
             lines.append('    Ref<%(domainName)sBackendDispatcherHandler::%(callbackName)s> callback = adoptRef(*new %(domainName)sBackendDispatcherHandler::%(callbackName)s(m_backendDispatcher.copyRef(), requestId));' % command_args)
         if len(command.return_parameters) > 0:
@@ -317,7 +317,7 @@
 
         if not command.is_async:
             lines.append('    if (!error.length())')
-            lines.append('        m_backendDispatcher->sendResponse(requestId, WTFMove(result));')
+            lines.append('        m_backendDispatcher->sendResponse(requestId, WTFMove(result), false);')
             lines.append('    else')
             lines.append('        m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));')
         lines.append('}')
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py	Fri Jan 05 11:40:42 2018 +0530
@@ -51,7 +51,7 @@
     def generate_output(self):
         headers = [
             '"%sProtocolObjects.h"' % self.protocol_name(),
-            '<inspector/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
             '<wtf/text/WTFString.h>']
 
         header_args = {
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py	Fri Jan 05 11:40:42 2018 +0530
@@ -111,11 +111,11 @@
 
         lines.append('void %(domainName)sFrontendDispatcher::%(eventName)s(%(formalParameters)s)' % event_args)
         lines.append('{')
-        lines.append('    Ref<InspectorObject> jsonMessage = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> jsonMessage = JSON::Object::create();')
         lines.append('    jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%(domainName)s.%(eventName)s"));' % event_args)
 
         if len(parameter_assignments) > 0:
-            lines.append('    Ref<InspectorObject> paramsObject = InspectorObject::create();')
+            lines.append('    Ref<JSON::Object> paramsObject = JSON::Object::create();')
             lines.extend(parameter_assignments)
             lines.append('    jsonMessage->setObject(ASCIILiteral("params"), WTFMove(paramsObject));')
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py	Fri Jan 05 11:40:42 2018 +0530
@@ -205,7 +205,7 @@
         lines = []
         if len(type_declaration.description) > 0:
             lines.append('/* %s */' % type_declaration.description)
-        base_class = 'Inspector::InspectorObject'
+        base_class = 'JSON::Object'
         if not Generator.type_has_open_fields(type_declaration.type):
             base_class = base_class + 'Base'
         lines.append('class %s : public %s {' % (object_name, base_class))
@@ -326,11 +326,11 @@
         lines.append('    void set%(camelName)s(%(parameterType)s value)' % setter_args)
         lines.append('    {')
         if isinstance(type_member.type, EnumType):
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(value));' % setter_args)
+            lines.append('        JSON::ObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), Inspector::Protocol::%(helpersNamespace)s::getEnumConstantValue(value));' % setter_args)
         elif CppGenerator.should_use_references_for_type(type_member.type):
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), WTFMove(value));' % setter_args)
+            lines.append('        JSON::ObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), WTFMove(value));' % setter_args)
         else:
-            lines.append('        InspectorObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), value);' % setter_args)
+            lines.append('        JSON::ObjectBase::%(keyedSet)s(ASCIILiteral("%(name)s"), value);' % setter_args)
         lines.append('    }')
         return '\n'.join(lines)
 
@@ -361,9 +361,9 @@
         for argument in type_arguments:
             lines.append('template<> %s BindingTraits<%s> {' % (' '.join(struct_keywords), argument[0]))
             if argument[1]:
-                lines.append('static RefPtr<%s> runtimeCast(RefPtr<Inspector::InspectorValue>&& value);' % argument[0])
+                lines.append('static RefPtr<%s> runtimeCast(RefPtr<JSON::Value>&& value);' % argument[0])
             lines.append('#if !ASSERT_DISABLED')
-            lines.append('%s assertValueHasExpectedType(Inspector::InspectorValue*);' % ' '.join(function_keywords))
+            lines.append('%s assertValueHasExpectedType(JSON::Value*);' % ' '.join(function_keywords))
             lines.append('#endif // !ASSERT_DISABLED')
             lines.append('};')
         return '\n'.join(lines)
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py	Fri Jan 05 11:40:42 2018 +0530
@@ -198,10 +198,10 @@
         lines = []
 
         lines.append('#if !ASSERT_DISABLED')
-        lines.append('void BindingTraits<%s>::assertValueHasExpectedType(Inspector::InspectorValue* value)' % (CppGenerator.cpp_protocol_type_for_type(object_declaration.type)))
+        lines.append('void BindingTraits<%s>::assertValueHasExpectedType(JSON::Value* value)' % (CppGenerator.cpp_protocol_type_for_type(object_declaration.type)))
         lines.append("""{
     ASSERT_ARG(value, value);
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
     ASSERT_UNUSED(castSucceeded, castSucceeded);""")
         for type_member in required_members:
@@ -211,7 +211,7 @@
             }
 
             lines.append("""    {
-        InspectorObject::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
+        JSON::Object::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
         ASSERT(%(memberName)sPos != object->end());
         %(assertMethod)s(%(memberName)sPos->value.get());
     }""" % args)
@@ -227,7 +227,7 @@
             }
 
             lines.append("""    {
-        InspectorObject::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
+        JSON::Object::iterator %(memberName)sPos = object->find(ASCIILiteral("%(memberName)s"));
         if (%(memberName)sPos != object->end()) {
             %(assertMethod)s(%(memberName)sPos->value.get());""" % args)
 
@@ -246,7 +246,7 @@
     def _generate_assertion_for_enum(self, enum_member, object_declaration):
         lines = []
         lines.append('#if !ASSERT_DISABLED')
-        lines.append('void %s(Inspector::InspectorValue* value)' % CppGenerator.cpp_assertion_method_for_type_member(enum_member, object_declaration))
+        lines.append('void %s(JSON::Value* value)' % CppGenerator.cpp_assertion_method_for_type_member(enum_member, object_declaration))
         lines.append('{')
         lines.append('    ASSERT_ARG(value, value);')
         lines.append('    String result;')
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py	Fri Jan 05 11:40:42 2018 +0530
@@ -53,7 +53,7 @@
         secondary_headers = [
             '"%sInternal.h"' % self.protocol_name(),
             '"%sTypeConversions.h"' % self.protocol_name(),
-            '<JavaScriptCore/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
         ]
 
         header_args = {
@@ -112,7 +112,7 @@
             lines.append('    id successCallback = ^{')
 
         if command.return_parameters:
-            lines.append('        Ref<InspectorObject> resultObject = InspectorObject::create();')
+            lines.append('        Ref<JSON::Object> resultObject = JSON::Object::create();')
 
             required_pointer_parameters = filter(lambda parameter: not parameter.is_optional and ObjCGenerator.is_type_objc_pointer_type(parameter.type), command.return_parameters)
             for parameter in required_pointer_parameters:
@@ -140,9 +140,9 @@
                 else:
                     lines.append('        if (%s)' % var_name)
                     lines.append('            resultObject->%s(ASCIILiteral("%s"), %s);' % (keyed_set_method, parameter.parameter_name, export_expression))
-            lines.append('        backendDispatcher()->sendResponse(requestId, WTFMove(resultObject));')
+            lines.append('        backendDispatcher()->sendResponse(requestId, WTFMove(resultObject), false);')
         else:
-            lines.append('        backendDispatcher()->sendResponse(requestId, InspectorObject::create());')
+            lines.append('        backendDispatcher()->sendResponse(requestId, JSON::Object::create(), false);')
 
         lines.append('    };')
         return '\n'.join(lines)
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py	Fri Jan 05 11:40:42 2018 +0530
@@ -50,7 +50,7 @@
     def generate_output(self):
         secondary_headers = [
             '"%sTypeConversions.h"' % self.protocol_name(),
-            '<JavaScriptCore/InspectorValues.h>',
+            '<wtf/JSONValues.h>',
         ]
 
         header_args = {
@@ -119,7 +119,7 @@
         if required_pointer_parameters or optional_pointer_parameters:
             lines.append('')
 
-        lines.append('    Ref<InspectorObject> jsonMessage = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> jsonMessage = JSON::Object::create();')
         lines.append('    jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("%s.%s"));' % (domain.domain_name, event.event_name))
         if event.event_parameters:
             lines.extend(self._generate_event_out_parameters(domain, event))
@@ -139,7 +139,7 @@
 
     def _generate_event_out_parameters(self, domain, event):
         lines = []
-        lines.append('    Ref<InspectorObject> paramsObject = InspectorObject::create();')
+        lines.append('    Ref<JSON::Object> paramsObject = JSON::Object::create();')
         for parameter in event.event_parameters:
             keyed_set_method = CppGenerator.cpp_setter_method_for_type(parameter.type)
             var_name = parameter.parameter_name
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_internal_header.py	Fri Jan 05 11:40:42 2018 +0530
@@ -47,8 +47,8 @@
         headers = set([
             '"%s.h"' % self.protocol_name(),
             '"%sJSONObjectPrivate.h"' % self.protocol_name(),
-            '<JavaScriptCore/InspectorValues.h>',
             '<JavaScriptCore/AugmentableInspectorController.h>',
+            '<wtf/JSONValues.h>',
         ])
 
         header_args = {
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py	Fri Jan 05 11:40:42 2018 +0530
@@ -57,8 +57,8 @@
         secondary_headers = [
             '"%sTypeConversions.h"' % self.protocol_name(),
             Generator.string_for_file_include('%sJSONObjectPrivate.h' % ObjCGenerator.OBJC_STATIC_PREFIX, Frameworks.WebInspector, self.model().framework),
-            '<JavaScriptCore/InspectorValues.h>',
             '<wtf/Assertions.h>',
+            '<wtf/JSONValues.h>',
         ]
 
         # The FooProtocolInternal.h header is only needed to declare the backend-side event dispatcher bindings.
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generator.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/inspector/scripts/codegen/generator.py	Fri Jan 05 11:40:42 2018 +0530
@@ -47,7 +47,7 @@
     'webgpu': 'WebGPU',  # Canvas.ContextType.webgpu
 }
 
-# These objects are built manually by creating and setting InspectorValues.
+# These objects are built manually by creating and setting JSON::Value instances.
 # Before sending these over the protocol, their shapes are checked against the specification.
 # So, any types referenced by these types require debug-only assertions that check values.
 # Calculating necessary assertions is annoying, and adds a lot of complexity to the generator.
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSONObject.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSONObject.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -355,7 +355,9 @@
     }
 
     if (value.isString()) {
-        builder.appendQuotedJSONString(asString(value)->value(m_exec));
+        const String& string = asString(value)->value(m_exec);
+        RETURN_IF_EXCEPTION(scope, StringifyFailed);
+        builder.appendQuotedJSONString(string);
         return StringifySucceeded;
     }
 
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSObject.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSObject.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -771,17 +771,23 @@
 
             JSValue gs = obj->getDirect(offset);
             if (gs.isGetterSetter()) {
-                bool result = callSetter(exec, slot.thisValue(), gs, value, slot.isStrictMode() ? StrictMode : NotStrictMode);
+                // We need to make sure that we decide to cache this property before we potentially execute aribitrary JS.
                 if (!structure()->isDictionary())
                     slot.setCacheableSetter(obj, offset);
+
+                bool result = callSetter(exec, slot.thisValue(), gs, value, slot.isStrictMode() ? StrictMode : NotStrictMode);
+                RETURN_IF_EXCEPTION(scope, false);
                 return result;
             }
             if (gs.isCustomGetterSetter()) {
-                bool result = callCustomSetter(exec, gs, attributes & CustomAccessor, obj, slot.thisValue(), value);
+                // We need to make sure that we decide to cache this property before we potentially execute aribitrary JS.
                 if (attributes & CustomAccessor)
                     slot.setCustomAccessor(obj, jsCast<CustomGetterSetter*>(gs.asCell())->setter());
                 else
                     slot.setCustomValue(obj, jsCast<CustomGetterSetter*>(gs.asCell())->setter());
+
+                bool result = callCustomSetter(exec, gs, attributes & CustomAccessor, obj, slot.thisValue(), value);
+                RETURN_IF_EXCEPTION(scope, false);
                 return result;
             }
             ASSERT(!(attributes & Accessor));
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/Lookup.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/Lookup.h	Fri Jan 05 11:40:42 2018 +0530
@@ -289,11 +289,14 @@
         ASSERT_WITH_MESSAGE(!(entry->attributes() & DOMJITAttribute), "DOMJITAttribute supports readonly attributes currently.");
         bool isAccessor = entry->attributes() & CustomAccessor;
         JSValue updateThisValue = entry->attributes() & CustomAccessor ? slot.thisValue() : JSValue(base);
-        bool result = callCustomSetter(exec, entry->propertyPutter(), isAccessor, updateThisValue, value);
+        // We need to make sure that we decide to cache this property before we potentially execute aribitrary JS.
         if (isAccessor)
             slot.setCustomAccessor(base, entry->propertyPutter());
         else
             slot.setCustomValue(base, entry->propertyPutter());
+
+        bool result = callCustomSetter(exec, entry->propertyPutter(), isAccessor, updateThisValue, value);
+        RETURN_IF_EXCEPTION(scope, false);
         return result;
     }
 
--- a/modules/javafx.web/src/main/native/Source/WTF/wtf/CMakeLists.txt	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WTF/wtf/CMakeLists.txt	Fri Jan 05 11:40:42 2018 +0530
@@ -59,6 +59,7 @@
     IndexedContainerIterator.h
     IteratorAdaptors.h
     IteratorRange.h
+    JSONValues.h
     ListHashSet.h
     Liveness.h
     Lock.h
@@ -226,6 +227,7 @@
     GlobalVersion.cpp
     GregorianDateTime.cpp
     HashTable.cpp
+    JSONValues.cpp
     Lock.cpp
     LockedPrintStream.cpp
     MD5.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/native/Source/WTF/wtf/JSONValues.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -0,0 +1,853 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSONValues.h"
+
+#include <wtf/DecimalNumber.h>
+#include <wtf/dtoa.h>
+#include <wtf/text/StringBuilder.h>
+
+namespace WTF {
+namespace JSONImpl {
+
+namespace {
+
+static const int stackLimit = 1000;
+
+enum class Token {
+    ObjectBegin,
+    ObjectEnd,
+    ArrayBegin,
+    ArrayEnd,
+    String,
+    Number,
+    BoolTrue,
+    BoolFalse,
+    Null,
+    ListSeparator,
+    ObjectPairSeparator,
+    Invalid,
+};
+
+const char* const nullString = "null";
+const char* const trueString = "true";
+const char* const falseString = "false";
+
+bool parseConstToken(const UChar* start, const UChar* end, const UChar** tokenEnd, const char* token)
+{
+    while (start < end && *token != '\0' && *start++ == *token++) { }
+
+    if (*token != '\0')
+        return false;
+
+    *tokenEnd = start;
+    return true;
+}
+
+bool readInt(const UChar* start, const UChar* end, const UChar** tokenEnd, bool canHaveLeadingZeros)
+{
+    if (start == end)
+        return false;
+
+    bool haveLeadingZero = '0' == *start;
+    int length = 0;
+    while (start < end && '0' <= *start && *start <= '9') {
+        ++start;
+        ++length;
+    }
+
+    if (!length)
+        return false;
+
+    if (!canHaveLeadingZeros && length > 1 && haveLeadingZero)
+        return false;
+
+    *tokenEnd = start;
+    return true;
+}
+
+bool parseNumberToken(const UChar* start, const UChar* end, const UChar** tokenEnd)
+{
+    // We just grab the number here. We validate the size in DecodeNumber.
+    // According to RFC 4627, a valid number is: [minus] int [frac] [exp]
+    if (start == end)
+        return false;
+
+    UChar c = *start;
+    if ('-' == c)
+        ++start;
+
+    if (!readInt(start, end, &start, false))
+        return false;
+
+    if (start == end) {
+        *tokenEnd = start;
+        return true;
+    }
+
+    // Optional fraction part.
+    c = *start;
+    if ('.' == c) {
+        ++start;
+        if (!readInt(start, end, &start, true))
+            return false;
+        if (start == end) {
+            *tokenEnd = start;
+            return true;
+        }
+        c = *start;
+    }
+
+    // Optional exponent part.
+    if ('e' == c || 'E' == c) {
+        ++start;
+        if (start == end)
+            return false;
+        c = *start;
+        if ('-' == c || '+' == c) {
+            ++start;
+            if (start == end)
+                return false;
+        }
+        if (!readInt(start, end, &start, true))
+            return false;
+    }
+
+    *tokenEnd = start;
+    return true;
+}
+
+bool readHexDigits(const UChar* start, const UChar* end, const UChar** tokenEnd, int digits)
+{
+    if (end - start < digits)
+        return false;
+
+    for (int i = 0; i < digits; ++i) {
+        if (!isASCIIHexDigit(*start++))
+            return false;
+    }
+
+    *tokenEnd = start;
+    return true;
+}
+
+bool parseStringToken(const UChar* start, const UChar* end, const UChar** tokenEnd)
+{
+    while (start < end) {
+        UChar c = *start++;
+        if ('\\' == c) {
+            c = *start++;
+            // Make sure the escaped char is valid.
+            switch (c) {
+            case 'x':
+                if (!readHexDigits(start, end, &start, 2))
+                    return false;
+                break;
+            case 'u':
+                if (!readHexDigits(start, end, &start, 4))
+                    return false;
+                break;
+            case '\\':
+            case '/':
+            case 'b':
+            case 'f':
+            case 'n':
+            case 'r':
+            case 't':
+            case 'v':
+            case '"':
+                break;
+            default:
+                return false;
+            }
+        } else if ('"' == c) {
+            *tokenEnd = start;
+            return true;
+        }
+    }
+
+    return false;
+}
+
+Token parseToken(const UChar* start, const UChar* end, const UChar** tokenStart, const UChar** tokenEnd)
+{
+    while (start < end && isSpaceOrNewline(*start))
+        ++start;
+
+    if (start == end)
+        return Token::Invalid;
+
+    *tokenStart = start;
+
+    switch (*start) {
+    case 'n':
+        if (parseConstToken(start, end, tokenEnd, nullString))
+            return Token::Null;
+        break;
+    case 't':
+        if (parseConstToken(start, end, tokenEnd, trueString))
+            return Token::BoolTrue;
+        break;
+    case 'f':
+        if (parseConstToken(start, end, tokenEnd, falseString))
+            return Token::BoolFalse;
+        break;
+    case '[':
+        *tokenEnd = start + 1;
+        return Token::ArrayBegin;
+    case ']':
+        *tokenEnd = start + 1;
+        return Token::ArrayEnd;
+    case ',':
+        *tokenEnd = start + 1;
+        return Token::ListSeparator;
+    case '{':
+        *tokenEnd = start + 1;
+        return Token::ObjectBegin;
+    case '}':
+        *tokenEnd = start + 1;
+        return Token::ObjectEnd;
+    case ':':
+        *tokenEnd = start + 1;
+        return Token::ObjectPairSeparator;
+    case '0':
+    case '1':
+    case '2':
+    case '3':
+    case '4':
+    case '5':
+    case '6':
+    case '7':
+    case '8':
+    case '9':
+    case '-':
+        if (parseNumberToken(start, end, tokenEnd))
+            return Token::Number;
+        break;
+    case '"':
+        if (parseStringToken(start + 1, end, tokenEnd))
+            return Token::String;
+        break;
+    }
+
+    return Token::Invalid;
+}
+
+bool decodeString(const UChar* start, const UChar* end, StringBuilder& output)
+{
+    while (start < end) {
+        UChar c = *start++;
+        if ('\\' != c) {
+            output.append(c);
+            continue;
+        }
+        c = *start++;
+        switch (c) {
+        case '"':
+        case '/':
+        case '\\':
+            break;
+        case 'b':
+            c = '\b';
+            break;
+        case 'f':
+            c = '\f';
+            break;
+        case 'n':
+            c = '\n';
+            break;
+        case 'r':
+            c = '\r';
+            break;
+        case 't':
+            c = '\t';
+            break;
+        case 'v':
+            c = '\v';
+            break;
+        case 'x':
+            c = toASCIIHexValue(start[0], start[1]);
+            start += 2;
+            break;
+        case 'u':
+            c = toASCIIHexValue(start[0], start[1]) << 8 | toASCIIHexValue(start[2], start[3]);
+            start += 4;
+            break;
+        default:
+            return false;
+        }
+        output.append(c);
+    }
+
+    return true;
+}
+
+bool decodeString(const UChar* start, const UChar* end, String& output)
+{
+    if (start == end) {
+        output = emptyString();
+        return true;
+    }
+
+    if (start > end)
+        return false;
+
+    StringBuilder buffer;
+    buffer.reserveCapacity(end - start);
+    if (!decodeString(start, end, buffer))
+        return false;
+
+    output = buffer.toString();
+    return true;
+}
+
+RefPtr<JSON::Value> buildValue(const UChar* start, const UChar* end, const UChar** valueTokenEnd, int depth)
+{
+    if (depth > stackLimit)
+        return nullptr;
+
+    RefPtr<JSON::Value> result;
+    const UChar* tokenStart;
+    const UChar* tokenEnd;
+    Token token = parseToken(start, end, &tokenStart, &tokenEnd);
+    switch (token) {
+    case Token::Invalid:
+        return nullptr;
+    case Token::Null:
+        result = JSON::Value::null();
+        break;
+    case Token::BoolTrue:
+        result = JSON::Value::create(true);
+        break;
+    case Token::BoolFalse:
+        result = JSON::Value::create(false);
+        break;
+    case Token::Number: {
+        bool ok;
+        double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
+        if (!ok)
+            return nullptr;
+        result = JSON::Value::create(value);
+        break;
+    }
+    case Token::String: {
+        String value;
+        bool ok = decodeString(tokenStart + 1, tokenEnd - 1, value);
+        if (!ok)
+            return nullptr;
+        result = JSON::Value::create(value);
+        break;
+    }
+    case Token::ArrayBegin: {
+        Ref<JSON::Array> array = JSON::Array::create();
+        start = tokenEnd;
+        token = parseToken(start, end, &tokenStart, &tokenEnd);
+        while (token != Token::ArrayEnd) {
+            RefPtr<JSON::Value> arrayNode = buildValue(start, end, &tokenEnd, depth + 1);
+            if (!arrayNode)
+                return nullptr;
+            array->pushValue(WTFMove(arrayNode));
+
+            // After a list value, we expect a comma or the end of the list.
+            start = tokenEnd;
+            token = parseToken(start, end, &tokenStart, &tokenEnd);
+            if (token == Token::ListSeparator) {
+                start = tokenEnd;
+                token = parseToken(start, end, &tokenStart, &tokenEnd);
+                if (token == Token::ArrayEnd)
+                    return nullptr;
+            } else if (token != Token::ArrayEnd) {
+                // Unexpected value after list value. Bail out.
+                return nullptr;
+            }
+        }
+        if (token != Token::ArrayEnd)
+            return nullptr;
+        result = WTFMove(array);
+        break;
+    }
+    case Token::ObjectBegin: {
+        Ref<JSON::Object> object = JSON::Object::create();
+        start = tokenEnd;
+        token = parseToken(start, end, &tokenStart, &tokenEnd);
+        while (token != Token::ObjectEnd) {
+            if (token != Token::String)
+                return nullptr;
+            String key;
+            if (!decodeString(tokenStart + 1, tokenEnd - 1, key))
+                return nullptr;
+            start = tokenEnd;
+
+            token = parseToken(start, end, &tokenStart, &tokenEnd);
+            if (token != Token::ObjectPairSeparator)
+                return nullptr;
+            start = tokenEnd;
+
+            RefPtr<JSON::Value> value = buildValue(start, end, &tokenEnd, depth + 1);
+            if (!value)
+                return nullptr;
+            object->setValue(key, WTFMove(value));
+            start = tokenEnd;
+
+            // After a key/value pair, we expect a comma or the end of the
+            // object.
+            token = parseToken(start, end, &tokenStart, &tokenEnd);
+            if (token == Token::ListSeparator) {
+                start = tokenEnd;
+                token = parseToken(start, end, &tokenStart, &tokenEnd);
+                if (token == Token::ObjectEnd)
+                    return nullptr;
+            } else if (token != Token::ObjectEnd) {
+                // Unexpected value after last object value. Bail out.
+                return nullptr;
+            }
+        }
+        if (token != Token::ObjectEnd)
+            return nullptr;
+        result = WTFMove(object);
+        break;
+    }
+
+    default:
+        // We got a token that's not a value.
+        return nullptr;
+    }
+    *valueTokenEnd = tokenEnd;
+    return result;
+}
+
+inline bool escapeChar(UChar c, StringBuilder& dst)
+{
+    switch (c) {
+    case '\b': dst.appendLiteral("\\b"); break;
+    case '\f': dst.appendLiteral("\\f"); break;
+    case '\n': dst.appendLiteral("\\n"); break;
+    case '\r': dst.appendLiteral("\\r"); break;
+    case '\t': dst.appendLiteral("\\t"); break;
+    case '\\': dst.appendLiteral("\\\\"); break;
+    case '"': dst.appendLiteral("\\\""); break;
+    default:
+        return false;
+    }
+    return true;
+}
+
+inline void doubleQuoteString(const String& str, StringBuilder& dst)
+{
+    dst.append('"');
+    for (unsigned i = 0; i < str.length(); ++i) {
+        UChar c = str[i];
+        if (!escapeChar(c, dst)) {
+            if (c < 32 || c > 126 || c == '<' || c == '>') {
+                // 1. Escaping <, > to prevent script execution.
+                // 2. Technically, we could also pass through c > 126 as UTF8, but this
+                //    is also optional. It would also be a pain to implement here.
+                dst.append(String::format("\\u%04X", c));
+            } else
+                dst.append(c);
+        }
+    }
+    dst.append('"');
+}
+
+} // anonymous namespace
+
+Ref<Value> Value::null()
+{
+    return adoptRef(*new Value);
+}
+
+Ref<Value> Value::create(bool value)
+{
+    return adoptRef(*new Value(value));
+}
+
+Ref<Value> Value::create(int value)
+{
+    return adoptRef(*new Value(value));
+}
+
+Ref<Value> Value::create(double value)
+{
+    return adoptRef(*new Value(value));
+}
+
+Ref<Value> Value::create(const String& value)
+{
+    return adoptRef(*new Value(value));
+}
+
+Ref<Value> Value::create(const char* value)
+{
+    return adoptRef(*new Value(value));
+}
+
+bool Value::asValue(RefPtr<Value>& value)
+{
+    value = this;
+    return true;
+}
+
+bool Value::asObject(RefPtr<Object>&)
+{
+    return false;
+}
+
+bool Value::asArray(RefPtr<Array>&)
+{
+    return false;
+}
+
+bool Value::parseJSON(const String& jsonInput, RefPtr<Value>& output)
+{
+    // FIXME: This whole file should just use StringView instead of UChar/length and avoid upconverting.
+    auto characters = StringView(jsonInput).upconvertedCharacters();
+    const UChar* start = characters;
+    const UChar* end = start + jsonInput.length();
+    const UChar* tokenEnd;
+    auto result = buildValue(start, end, &tokenEnd, 0);
+    if (!result || tokenEnd != end)
+        return false;
+
+    output = WTFMove(result);
+    return true;
+}
+
+String Value::toJSONString() const
+{
+    StringBuilder result;
+    result.reserveCapacity(512);
+    writeJSON(result);
+    return result.toString();
+}
+
+bool Value::asBoolean(bool& output) const
+{
+    if (type() != Type::Boolean)
+        return false;
+
+    output = m_value.boolean;
+    return true;
+}
+
+bool Value::asDouble(double& output) const
+{
+    if (type() != Type::Double)
+        return false;
+
+    output = m_value.number;
+    return true;
+}
+
+bool Value::asDouble(float& output) const
+{
+    if (type() != Type::Double)
+        return false;
+
+    output = static_cast<float>(m_value.number);
+    return true;
+}
+
+bool Value::asInteger(int& output) const
+{
+    if (type() != Type::Integer && type() != Type::Double)
+        return false;
+
+    output = static_cast<int>(m_value.number);
+    return true;
+}
+
+bool Value::asInteger(unsigned& output) const
+{
+    if (type() != Type::Integer && type() != Type::Double)
+        return false;
+
+    output = static_cast<unsigned>(m_value.number);
+    return true;
+}
+
+bool Value::asInteger(long& output) const
+{
+    if (type() != Type::Integer && type() != Type::Double)
+        return false;
+
+    output = static_cast<long>(m_value.number);
+    return true;
+}
+
+bool Value::asInteger(long long& output) const
+{
+    if (type() != Type::Integer && type() != Type::Double)
+        return false;
+
+    output = static_cast<long long>(m_value.number);
+    return true;
+}
+
+bool Value::asInteger(unsigned long& output) const
+{
+    if (type() != Type::Integer && type() != Type::Double)
+        return false;
+
+    output = static_cast<unsigned long>(m_value.number);
+    return true;
+}
+
+bool Value::asInteger(unsigned long long& output) const
+{
+    if (type() != Type::Integer && type() != Type::Double)
+        return false;
+
+    output = static_cast<unsigned long long>(m_value.number);
+    return true;
+}
+
+bool Value::asString(String& output) const
+{
+    if (type() != Type::String)
+        return false;
+
+    output = m_value.string;
+    return true;
+}
+
+void Value::writeJSON(StringBuilder& output) const
+{
+    switch (m_type) {
+    case Type::Null:
+        output.appendLiteral("null");
+        break;
+    case Type::Boolean:
+        if (m_value.boolean)
+            output.appendLiteral("true");
+        else
+            output.appendLiteral("false");
+        break;
+    case Type::String:
+        doubleQuoteString(m_value.string, output);
+        break;
+    case Type::Double:
+    case Type::Integer: {
+        NumberToLStringBuffer buffer;
+        if (!std::isfinite(m_value.number)) {
+            output.appendLiteral("null");
+            return;
+        }
+        DecimalNumber decimal = m_value.number;
+        unsigned length = 0;
+        if (decimal.bufferLengthForStringDecimal() > WTF::NumberToStringBufferLength) {
+            // Not enough room for decimal. Use exponential format.
+            if (decimal.bufferLengthForStringExponential() > WTF::NumberToStringBufferLength) {
+                // Fallback for an abnormal case if it's too little even for exponential.
+                output.appendLiteral("NaN");
+                return;
+            }
+            length = decimal.toStringExponential(buffer, WTF::NumberToStringBufferLength);
+        } else
+            length = decimal.toStringDecimal(buffer, WTF::NumberToStringBufferLength);
+        output.append(buffer, length);
+        break;
+    }
+    default:
+        ASSERT_NOT_REACHED();
+    }
+}
+
+size_t Value::memoryCost() const
+{
+    size_t memoryCost = sizeof(this);
+    if (m_type == Type::String && m_value.string)
+        memoryCost += m_value.string->sizeInBytes();
+    return memoryCost;
+}
+
+ObjectBase::~ObjectBase()
+{
+}
+
+bool ObjectBase::asObject(RefPtr<Object>& output)
+{
+    COMPILE_ASSERT(sizeof(Object) == sizeof(ObjectBase), cannot_cast);
+
+    output = static_cast<Object*>(this);
+    return true;
+}
+
+Object* ObjectBase::openAccessors()
+{
+    COMPILE_ASSERT(sizeof(Object) == sizeof(ObjectBase), cannot_cast);
+
+    return static_cast<Object*>(this);
+}
+
+size_t ObjectBase::memoryCost() const
+{
+    size_t memoryCost = Value::memoryCost();
+    for (const auto& entry : m_map) {
+        memoryCost += entry.key.sizeInBytes();
+        if (entry.value)
+            memoryCost += entry.value->memoryCost();
+    }
+    return memoryCost;
+}
+
+bool ObjectBase::getBoolean(const String& name, bool& output) const
+{
+    RefPtr<Value> value;
+    if (!getValue(name, value))
+        return false;
+
+    return value->asBoolean(output);
+}
+
+bool ObjectBase::getString(const String& name, String& output) const
+{
+    RefPtr<Value> value;
+    if (!getValue(name, value))
+        return false;
+
+    return value->asString(output);
+}
+
+bool ObjectBase::getObject(const String& name, RefPtr<Object>& output) const
+{
+    RefPtr<Value> value;
+    if (!getValue(name, value))
+        return false;
+
+    return value->asObject(output);
+}
+
+bool ObjectBase::getArray(const String& name, RefPtr<Array>& output) const
+{
+    RefPtr<Value> value;
+    if (!getValue(name, value))
+        return false;
+
+    return value->asArray(output);
+}
+
+bool ObjectBase::getValue(const String& name, RefPtr<Value>& output) const
+{
+    Dictionary::const_iterator findResult = m_map.find(name);
+    if (findResult == m_map.end())
+        return false;
+
+    output = findResult->value;
+    return true;
+}
+
+void ObjectBase::remove(const String& name)
+{
+    m_map.remove(name);
+    m_order.removeFirst(name);
+}
+
+void ObjectBase::writeJSON(StringBuilder& output) const
+{
+    output.append('{');
+    for (size_t i = 0; i < m_order.size(); ++i) {
+        auto findResult = m_map.find(m_order[i]);
+        ASSERT(findResult != m_map.end());
+        if (i)
+            output.append(',');
+        doubleQuoteString(findResult->key, output);
+        output.append(':');
+        findResult->value->writeJSON(output);
+    }
+    output.append('}');
+}
+
+ObjectBase::ObjectBase()
+    : Value(Type::Object)
+    , m_map()
+    , m_order()
+{
+}
+
+ArrayBase::~ArrayBase()
+{
+}
+
+bool ArrayBase::asArray(RefPtr<Array>& output)
+{
+    COMPILE_ASSERT(sizeof(ArrayBase) == sizeof(Array), cannot_cast);
+    output = static_cast<Array*>(this);
+    return true;
+}
+
+void ArrayBase::writeJSON(StringBuilder& output) const
+{
+    output.append('[');
+    for (Vector<RefPtr<Value>>::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {
+        if (it != m_map.begin())
+            output.append(',');
+        (*it)->writeJSON(output);
+    }
+    output.append(']');
+}
+
+ArrayBase::ArrayBase()
+    : Value(Type::Array)
+    , m_map()
+{
+}
+
+RefPtr<Value> ArrayBase::get(size_t index) const
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(index < m_map.size());
+    return m_map[index];
+}
+
+Ref<Object> Object::create()
+{
+    return adoptRef(*new Object);
+}
+
+Ref<Array> Array::create()
+{
+    return adoptRef(*new Array);
+}
+
+size_t ArrayBase::memoryCost() const
+{
+    size_t memoryCost = Value::memoryCost();
+    for (const auto& item : m_map) {
+        if (item)
+            memoryCost += item->memoryCost();
+    }
+    return memoryCost;
+}
+
+} // namespace JSONImpl
+} // namespace WTF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/main/native/Source/WTF/wtf/JSONValues.h	Fri Jan 05 11:40:42 2018 +0530
@@ -0,0 +1,432 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
+
+namespace WTF {
+
+// Make sure compiled symbols contain the WTF namespace prefix, but
+// use a different inner namespace name so that JSON::Value is not ambigious.
+// Otherwise, the compiler would have both WTF::JSON::Value and JSON::Value
+// in scope and client code would have to use WTF::JSON::Value, which is tedious.
+namespace JSONImpl {
+
+class Array;
+class ArrayBase;
+class Object;
+class ObjectBase;
+
+// FIXME: unify this JSON parser with JSONParse in JavaScriptCore.
+class WTF_EXPORT_PRIVATE Value : public RefCounted<Value> {
+public:
+    static const int maxDepth = 1000;
+
+    virtual ~Value()
+    {
+        switch (m_type) {
+        case Type::Null:
+        case Type::Boolean:
+        case Type::Double:
+        case Type::Integer:
+            break;
+        case Type::String:
+            if (m_value.string)
+                m_value.string->deref();
+            break;
+        case Type::Object:
+        case Type::Array:
+            break;
+        }
+    }
+
+    static Ref<Value> null();
+    static Ref<Value> create(bool);
+    static Ref<Value> create(int);
+    static Ref<Value> create(double);
+    static Ref<Value> create(const String&);
+    static Ref<Value> create(const char*);
+
+    enum class Type {
+        Null = 0,
+        Boolean,
+        Double,
+        Integer,
+        String,
+        Object,
+        Array,
+    };
+
+    Type type() const { return m_type; }
+    bool isNull() const { return m_type == Type::Null; }
+
+    bool asBoolean(bool&) const;
+    bool asInteger(int&) const;
+    bool asInteger(unsigned&) const;
+    bool asInteger(long&) const;
+    bool asInteger(long long&) const;
+    bool asInteger(unsigned long&) const;
+    bool asInteger(unsigned long long&) const;
+    bool asDouble(double&) const;
+    bool asDouble(float&) const;
+    bool asString(String&) const;
+    bool asValue(RefPtr<Value>&);
+
+    virtual bool asObject(RefPtr<Object>&);
+    virtual bool asArray(RefPtr<Array>&);
+
+    static bool parseJSON(const String& jsonInput, RefPtr<Value>& output);
+
+    String toJSONString() const;
+    virtual void writeJSON(StringBuilder& output) const;
+
+    virtual size_t memoryCost() const;
+
+protected:
+    Value()
+        : m_type { Type::Null }
+    {
+    }
+
+    explicit Value(Type type)
+        : m_type(type)
+    {
+    }
+
+    explicit Value(bool value)
+        : m_type { Type::Boolean }
+    {
+        m_value.boolean = value;
+    }
+
+    explicit Value(int value)
+        : m_type { Type::Integer }
+    {
+        m_value.number = static_cast<double>(value);
+    }
+
+    explicit Value(double value)
+        : m_type(Type::Double)
+    {
+        m_value.number = value;
+    }
+
+    explicit Value(const String& value)
+        : m_type { Type::String }
+    {
+        m_value.string = value.impl();
+        if (m_value.string)
+            m_value.string->ref();
+    }
+
+    explicit Value(const char* value)
+        : m_type { Type::String }
+    {
+        String wrapper(value);
+        m_value.string = wrapper.impl();
+        if (m_value.string)
+            m_value.string->ref();
+    }
+
+private:
+    Type m_type { Type::Null };
+    union {
+        bool boolean;
+        double number;
+        StringImpl* string;
+    } m_value;
+};
+
+class WTF_EXPORT_PRIVATE ObjectBase : public Value {
+private:
+    typedef HashMap<String, RefPtr<Value>> Dictionary;
+
+public:
+    typedef Dictionary::iterator iterator;
+    typedef Dictionary::const_iterator const_iterator;
+
+    Object* openAccessors();
+
+    size_t memoryCost() const final;
+
+protected:
+    virtual ~ObjectBase();
+
+    bool asObject(RefPtr<Object>& output) override;
+
+    // FIXME: use templates to reduce the amount of duplicated set*() methods.
+    void setBoolean(const String& name, bool);
+    void setInteger(const String& name, int);
+    void setDouble(const String& name, double);
+    void setString(const String& name, const String&);
+    void setValue(const String& name, RefPtr<Value>&&);
+    void setObject(const String& name, RefPtr<ObjectBase>&&);
+    void setArray(const String& name, RefPtr<ArrayBase>&&);
+
+    iterator find(const String& name);
+    const_iterator find(const String& name) const;
+
+    // FIXME: use templates to reduce the amount of duplicated get*() methods.
+    bool getBoolean(const String& name, bool& output) const;
+    template<class T> bool getDouble(const String& name, T& output) const
+    {
+        RefPtr<Value> value;
+        if (!getValue(name, value))
+            return false;
+
+        return value->asDouble(output);
+    }
+    template<class T> bool getInteger(const String& name, T& output) const
+    {
+        RefPtr<Value> value;
+        if (!getValue(name, value))
+            return false;
+
+        return value->asInteger(output);
+    }
+
+    bool getString(const String& name, String& output) const;
+    bool getObject(const String& name, RefPtr<Object>&) const;
+    bool getArray(const String& name, RefPtr<Array>&) const;
+    bool getValue(const String& name, RefPtr<Value>&) const;
+
+    void remove(const String& name);
+
+    void writeJSON(StringBuilder& output) const override;
+
+    iterator begin() { return m_map.begin(); }
+    iterator end() { return m_map.end(); }
+    const_iterator begin() const { return m_map.begin(); }
+    const_iterator end() const { return m_map.end(); }
+
+    int size() const { return m_map.size(); }
+
+protected:
+    ObjectBase();
+
+private:
+    Dictionary m_map;
+    Vector<String> m_order;
+};
+
+class Object : public ObjectBase {
+public:
+    static WTF_EXPORT_PRIVATE Ref<Object> create();
+
+    using ObjectBase::asObject;
+
+    // This class expected non-cyclic values, as we cannot serialize cycles in JSON.
+    using ObjectBase::setBoolean;
+    using ObjectBase::setInteger;
+    using ObjectBase::setDouble;
+    using ObjectBase::setString;
+    using ObjectBase::setValue;
+    using ObjectBase::setObject;
+    using ObjectBase::setArray;
+
+    using ObjectBase::find;
+    using ObjectBase::getBoolean;
+    using ObjectBase::getInteger;
+    using ObjectBase::getDouble;
+    using ObjectBase::getString;
+    using ObjectBase::getObject;
+    using ObjectBase::getArray;
+    using ObjectBase::getValue;
+
+    using ObjectBase::remove;
+
+    using ObjectBase::begin;
+    using ObjectBase::end;
+
+    using ObjectBase::size;
+};
+
+
+class WTF_EXPORT_PRIVATE ArrayBase : public Value {
+public:
+    typedef Vector<RefPtr<Value>>::iterator iterator;
+    typedef Vector<RefPtr<Value>>::const_iterator const_iterator;
+
+    unsigned length() const { return static_cast<unsigned>(m_map.size()); }
+
+    RefPtr<Value> get(size_t index) const;
+
+    size_t memoryCost() const final;
+
+protected:
+    virtual ~ArrayBase();
+
+    bool asArray(RefPtr<Array>&) override;
+
+    void pushBoolean(bool);
+    void pushInteger(int);
+    void pushDouble(double);
+    void pushString(const String&);
+    void pushValue(RefPtr<Value>&&);
+    void pushObject(RefPtr<ObjectBase>&&);
+    void pushArray(RefPtr<ArrayBase>&&);
+
+    void writeJSON(StringBuilder& output) const override;
+
+    iterator begin() { return m_map.begin(); }
+    iterator end() { return m_map.end(); }
+    const_iterator begin() const { return m_map.begin(); }
+    const_iterator end() const { return m_map.end(); }
+
+protected:
+    ArrayBase();
+
+private:
+    Vector<RefPtr<Value>> m_map;
+};
+
+class Array : public ArrayBase {
+public:
+    static WTF_EXPORT_PRIVATE Ref<Array> create();
+
+    using ArrayBase::asArray;
+
+    // This class expected non-cyclic values, as we cannot serialize cycles in JSON.
+    using ArrayBase::pushBoolean;
+    using ArrayBase::pushInteger;
+    using ArrayBase::pushDouble;
+    using ArrayBase::pushString;
+    using ArrayBase::pushValue;
+    using ArrayBase::pushObject;
+    using ArrayBase::pushArray;
+
+    using ArrayBase::get;
+
+    using ArrayBase::begin;
+    using ArrayBase::end;
+};
+
+
+inline ObjectBase::iterator ObjectBase::find(const String& name)
+{
+    return m_map.find(name);
+}
+
+inline ObjectBase::const_iterator ObjectBase::find(const String& name) const
+{
+    return m_map.find(name);
+}
+
+inline void ObjectBase::setBoolean(const String& name, bool value)
+{
+    setValue(name, Value::create(value));
+}
+
+inline void ObjectBase::setInteger(const String& name, int value)
+{
+    setValue(name, Value::create(value));
+}
+
+inline void ObjectBase::setDouble(const String& name, double value)
+{
+    setValue(name, Value::create(value));
+}
+
+inline void ObjectBase::setString(const String& name, const String& value)
+{
+    setValue(name, Value::create(value));
+}
+
+inline void ObjectBase::setValue(const String& name, RefPtr<Value>&& value)
+{
+    ASSERT(value);
+    if (m_map.set(name, WTFMove(value)).isNewEntry)
+        m_order.append(name);
+}
+
+inline void ObjectBase::setObject(const String& name, RefPtr<ObjectBase>&& value)
+{
+    ASSERT(value);
+    if (m_map.set(name, WTFMove(value)).isNewEntry)
+        m_order.append(name);
+}
+
+inline void ObjectBase::setArray(const String& name, RefPtr<ArrayBase>&& value)
+{
+    ASSERT(value);
+    if (m_map.set(name, WTFMove(value)).isNewEntry)
+        m_order.append(name);
+}
+
+inline void ArrayBase::pushBoolean(bool value)
+{
+    m_map.append(Value::create(value));
+}
+
+inline void ArrayBase::pushInteger(int value)
+{
+    m_map.append(Value::create(value));
+}
+
+inline void ArrayBase::pushDouble(double value)
+{
+    m_map.append(Value::create(value));
+}
+
+inline void ArrayBase::pushString(const String& value)
+{
+    m_map.append(Value::create(value));
+}
+
+inline void ArrayBase::pushValue(RefPtr<Value>&& value)
+{
+    ASSERT(value);
+    m_map.append(WTFMove(value));
+}
+
+inline void ArrayBase::pushObject(RefPtr<ObjectBase>&& value)
+{
+    ASSERT(value);
+    m_map.append(WTFMove(value));
+}
+
+inline void ArrayBase::pushArray(RefPtr<ArrayBase>&& value)
+{
+    ASSERT(value);
+    m_map.append(WTFMove(value));
+}
+
+} // namespace JSONImpl
+
+} // namespace WTF
+
+namespace JSON {
+using namespace WTF::JSONImpl;
+}
--- a/modules/javafx.web/src/main/native/Source/WebCore/ForwardingHeaders/inspector/InspectorValues.h	Fri Dec 22 12:50:57 2017 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#ifndef WebCore_FWD_InspectorValues_h
-#define WebCore_FWD_InspectorValues_h
-#include <JavaScriptCore/InspectorValues.h>
-#endif
--- a/modules/javafx.web/src/main/native/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -30,7 +30,7 @@
 
 #include "NotImplemented.h"
 #include "SharedBuffer.h"
-#include "inspector/InspectorValues.h"
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/Base64.h>
 
@@ -46,15 +46,15 @@
         return { };
     String json { buffer.data(), static_cast<unsigned>(buffer.size()) };
 
-    RefPtr<InspectorValue> value;
-    if (!InspectorValue::parseJSON(json, value))
+    RefPtr<JSON::Value> value;
+    if (!JSON::Value::parseJSON(json, value))
         return { };
 
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     if (!value->asObject(object))
         return { };
 
-    RefPtr<InspectorArray> kidsArray;
+    RefPtr<JSON::Array> kidsArray;
     if (!object->getArray("kids", kidsArray))
         return { };
 
@@ -83,8 +83,8 @@
     if (keyIDBuffer.isEmpty())
         return nullptr;
 
-    auto object = InspectorObject::create();
-    auto kidsArray = InspectorArray::create();
+    auto object = JSON::Object::create();
+    auto kidsArray = JSON::Array::create();
     for (auto& buffer : keyIDBuffer)
         kidsArray->pushString(WTF::base64URLEncode(buffer->data(), buffer->size()));
     object->setArray("kids", WTFMove(kidsArray));
--- a/modules/javafx.web/src/main/native/Source/WebCore/Modules/mediastream/SDPProcessor.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/Modules/mediastream/SDPProcessor.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -40,13 +40,11 @@
 #include "SDPProcessorScriptResource.h"
 #include "ScriptController.h"
 #include "ScriptSourceCode.h"
-#include "inspector/InspectorValues.h"
 #include <bindings/ScriptObject.h>
 #include <runtime/CatchScope.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 
-using namespace Inspector;
-
 namespace WebCore {
 
 #define STRING_FUNCTION(name) \
@@ -110,9 +108,9 @@
 // example, the JSON representation has an "ice" object which collects a set of properties under a
 // namespace. MediaEndpointSessionConfiguration has "ice"-prefixes on the corresponding properties.
 
-static RefPtr<InspectorObject> createCandidateObject(const IceCandidate& candidate)
+static RefPtr<JSON::Object> createCandidateObject(const IceCandidate& candidate)
 {
-    RefPtr<InspectorObject> candidateObject = InspectorObject::create();
+    RefPtr<JSON::Object> candidateObject = JSON::Object::create();
 
     candidateObject->setString(typeString(), candidate.type);
     candidateObject->setString(foundationString(), candidate.foundation);
@@ -131,7 +129,7 @@
     return candidateObject;
 }
 
-static IceCandidate createCandidate(const InspectorObject& candidateObject)
+static IceCandidate createCandidate(const JSON::Object& candidateObject)
 {
     IceCandidate candidate;
     String stringValue;
@@ -172,11 +170,11 @@
 
 static RefPtr<MediaEndpointSessionConfiguration> configurationFromJSON(const String& json)
 {
-    RefPtr<InspectorValue> value;
-    if (!InspectorValue::parseJSON(json, value))
+    RefPtr<JSON::Value> value;
+    if (!JSON::Value::parseJSON(json, value))
         return nullptr;
 
-    RefPtr<InspectorObject> object;
+    RefPtr<JSON::Object> object;
     if (!value->asObject(object))
         return nullptr;
 
@@ -186,7 +184,7 @@
     unsigned intValue;
     bool boolValue;
 
-    RefPtr<InspectorObject> originatorObject = InspectorObject::create();
+    RefPtr<JSON::Object> originatorObject = JSON::Object::create();
     if (object->getObject(originatorString(), originatorObject)) {
         if (originatorObject->getString(sessionIdString(), stringValue))
             configuration->setSessionId(stringValue.toInt64());
@@ -194,11 +192,11 @@
             configuration->setSessionVersion(intValue);
     }
 
-    RefPtr<InspectorArray> mediaDescriptionsArray = InspectorArray::create();
+    RefPtr<JSON::Array> mediaDescriptionsArray = JSON::Array::create();
     object->getArray(mediaDescriptionsString(), mediaDescriptionsArray);
 
     for (unsigned i = 0; i < mediaDescriptionsArray->length(); ++i) {
-        RefPtr<InspectorObject> mediaDescriptionObject = InspectorObject::create();
+        RefPtr<JSON::Object> mediaDescriptionObject = JSON::Object::create();
         mediaDescriptionsArray->get(i)->asObject(mediaDescriptionObject);
 
         PeerMediaDescription mediaDescription;
@@ -218,11 +216,11 @@
         if (mediaDescriptionObject->getString(midString(), stringValue))
             mediaDescription.mid = stringValue;
 
-        RefPtr<InspectorArray> payloadsArray = InspectorArray::create();
+        RefPtr<JSON::Array> payloadsArray = JSON::Array::create();
         mediaDescriptionObject->getArray(payloadsString(), payloadsArray);
 
         for (unsigned j = 0; j < payloadsArray->length(); ++j) {
-            RefPtr<InspectorObject> payloadsObject = InspectorObject::create();
+            RefPtr<JSON::Object> payloadsObject = JSON::Object::create();
             payloadsArray->get(j)->asObject(payloadsObject);
 
             MediaPayload payload;
@@ -248,7 +246,7 @@
             if (payloadsObject->getBoolean(nackString(), boolValue))
                 payload.nack = boolValue;
 
-            RefPtr<InspectorObject> parametersObject = InspectorObject::create();
+            RefPtr<JSON::Object> parametersObject = JSON::Object::create();
             if (payloadsObject->getObject(parametersString(), parametersObject)) {
                 if (parametersObject->getInteger(packetizationModeString(), intValue))
                     payload.addParameter("packetizationMode", intValue);
@@ -263,7 +261,7 @@
             mediaDescription.addPayload(WTFMove(payload));
         }
 
-        RefPtr<InspectorObject> rtcpObject = InspectorObject::create();
+        RefPtr<JSON::Object> rtcpObject = JSON::Object::create();
         if (mediaDescriptionObject->getObject(rtcpString(), rtcpObject)) {
             if (rtcpObject->getBoolean(muxString(), boolValue))
                 mediaDescription.rtcpMux = boolValue;
@@ -281,7 +279,7 @@
         if (mediaDescriptionObject->getString(mediaStreamTrackIdString(), stringValue))
             mediaDescription.mediaStreamTrackId = stringValue;
 
-        RefPtr<InspectorObject> dtlsObject = InspectorObject::create();
+        RefPtr<JSON::Object> dtlsObject = JSON::Object::create();
         if (mediaDescriptionObject->getObject(dtlsString(), dtlsObject)) {
             if (dtlsObject->getString(setupString(), stringValue))
                 mediaDescription.dtlsSetup = stringValue;
@@ -293,7 +291,7 @@
                 mediaDescription.dtlsFingerprint = stringValue;
         }
 
-        RefPtr<InspectorArray> ssrcsArray = InspectorArray::create();
+        RefPtr<JSON::Array> ssrcsArray = JSON::Array::create();
         mediaDescriptionObject->getArray(ssrcsString(), ssrcsArray);
 
         for (unsigned j = 0; j < ssrcsArray->length(); ++j) {
@@ -304,7 +302,7 @@
         if (mediaDescriptionObject->getString(cnameString(), stringValue))
             mediaDescription.cname = stringValue;
 
-        RefPtr<InspectorObject> iceObject = InspectorObject::create();
+        RefPtr<JSON::Object> iceObject = JSON::Object::create();
         if (mediaDescriptionObject->getObject(iceString(), iceObject)) {
             if (iceObject->getString(ufragString(), stringValue))
                 mediaDescription.iceUfrag = stringValue;
@@ -312,11 +310,11 @@
             if (iceObject->getString(passwordString(), stringValue))
                 mediaDescription.icePassword = stringValue;
 
-            RefPtr<InspectorArray> candidatesArray = InspectorArray::create();
+            RefPtr<JSON::Array> candidatesArray = JSON::Array::create();
             iceObject->getArray(candidatesString(), candidatesArray);
 
             for (unsigned j = 0; j < candidatesArray->length(); ++j) {
-                RefPtr<InspectorObject> candidateObject = InspectorObject::create();
+                RefPtr<JSON::Object> candidateObject = JSON::Object::create();
                 candidatesArray->get(j)->asObject(candidateObject);
 
                 mediaDescription.addIceCandidate(createCandidate(*candidateObject));
@@ -331,11 +329,11 @@
 
 static std::optional<IceCandidate> iceCandidateFromJSON(const String& json)
 {
-    RefPtr<InspectorValue> value;
-    if (!InspectorValue::parseJSON(json, value))
+    RefPtr<JSON::Value> value;
+    if (!JSON::Value::parseJSON(json, value))
         return std::nullopt;
 
-    RefPtr<InspectorObject> candidateObject;
+    RefPtr<JSON::Object> candidateObject;
     if (!value->asObject(candidateObject))
         return std::nullopt;
 
@@ -357,18 +355,18 @@
 
 static String configurationToJSON(const MediaEndpointSessionConfiguration& configuration)
 {
-    RefPtr<InspectorObject> object = InspectorObject::create();
+    RefPtr<JSON::Object> object = JSON::Object::create();
     object->setString(bundlePolicyString(), getBundlePolicyName(configuration.bundlePolicy()));
 
-    RefPtr<InspectorObject> originatorObject = InspectorObject::create();
+    RefPtr<JSON::Object> originatorObject = JSON::Object::create();
     originatorObject->setString(sessionIdString(), String::number(configuration.sessionId()));
     originatorObject->setInteger(sessionVersionString(), configuration.sessionVersion());
     object->setObject(originatorString(), originatorObject);
 
-    RefPtr<InspectorArray> mediaDescriptionsArray = InspectorArray::create();
+    RefPtr<JSON::Array> mediaDescriptionsArray = JSON::Array::create();
 
     for (const auto& mediaDescription : configuration.mediaDescriptions()) {
-        RefPtr<InspectorObject> mediaDescriptionObject = InspectorObject::create();
+        RefPtr<JSON::Object> mediaDescriptionObject = JSON::Object::create();
 
         mediaDescriptionObject->setString(typeString(), mediaDescription.type);
         mediaDescriptionObject->setInteger(portString(), mediaDescription.port);
@@ -376,10 +374,10 @@
         mediaDescriptionObject->setString(modeString(), mediaDescription.mode);
         mediaDescriptionObject->setString(midString(), mediaDescription.mid);
 
-        RefPtr<InspectorArray> payloadsArray = InspectorArray::create();
+        RefPtr<JSON::Array> payloadsArray = JSON::Array::create();
 
         for (auto& payload : mediaDescription.payloads) {
-            RefPtr<InspectorObject> payloadObject = InspectorObject::create();
+            RefPtr<JSON::Object> payloadObject = JSON::Object::create();
 
             payloadObject->setInteger(typeString(), payload.type);
             payloadObject->setString(encodingNameString(), payload.encodingName);
@@ -390,7 +388,7 @@
             payloadObject->setBoolean(nackString(), payload.nack);
 
             if (!payload.parameters.isEmpty()) {
-                RefPtr<InspectorObject> parametersObject = InspectorObject::create();
+                RefPtr<JSON::Object> parametersObject = JSON::Object::create();
 
                 for (auto& name : payload.parameters.keys())
                     parametersObject->setInteger(name, payload.parameters.get(name));
@@ -402,7 +400,7 @@
         }
         mediaDescriptionObject->setArray(payloadsString(), payloadsArray);
 
-        RefPtr<InspectorObject> rtcpObject = InspectorObject::create();
+        RefPtr<JSON::Object> rtcpObject = JSON::Object::create();
         rtcpObject->setBoolean(muxString(), mediaDescription.rtcpMux);
         rtcpObject->setString(addressString(), mediaDescription.rtcpAddress);
         rtcpObject->setInteger(portString(), mediaDescription.rtcpPort);
@@ -411,13 +409,13 @@
         mediaDescriptionObject->setString(mediaStreamIdString(), mediaDescription.mediaStreamId);
         mediaDescriptionObject->setString(mediaStreamTrackIdString(), mediaDescription.mediaStreamTrackId);
 
-        RefPtr<InspectorObject> dtlsObject = InspectorObject::create();
+        RefPtr<JSON::Object> dtlsObject = JSON::Object::create();
         dtlsObject->setString(setupString(), mediaDescription.dtlsSetup);
         dtlsObject->setString(fingerprintHashFunctionString(), mediaDescription.dtlsFingerprintHashFunction);
         dtlsObject->setString(fingerprintString(), mediaDescription.dtlsFingerprint);
         mediaDescriptionObject->setObject(dtlsString(), dtlsObject);
 
-        RefPtr<InspectorArray> ssrcsArray = InspectorArray::create();
+        RefPtr<JSON::Array> ssrcsArray = JSON::Array::create();
 
         for (auto ssrc : mediaDescription.ssrcs)
             ssrcsArray->pushDouble(ssrc);
@@ -425,11 +423,11 @@
 
         mediaDescriptionObject->setString(cnameString(), mediaDescription.cname);
 
-        RefPtr<InspectorObject> iceObject = InspectorObject::create();
+        RefPtr<JSON::Object> iceObject = JSON::Object::create();
         iceObject->setString(ufragString(), mediaDescription.iceUfrag);
         iceObject->setString(passwordString(), mediaDescription.icePassword);
 
-        RefPtr<InspectorArray> candidatesArray = InspectorArray::create();
+        RefPtr<JSON::Array> candidatesArray = JSON::Array::create();
 
         for (auto& candidate : mediaDescription.iceCandidates)
             candidatesArray->pushObject(createCandidateObject(candidate));
--- a/modules/javafx.web/src/main/native/Source/WebCore/PlatformGTK.cmake	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/PlatformGTK.cmake	Fri Jan 05 11:40:42 2018 +0530
@@ -188,7 +188,7 @@
     list(APPEND WebCore_DERIVED_SOURCES
         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
     )
-    execute_process(COMMAND pkg-config --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
+    execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
     add_custom_command(
          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
--- a/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	Fri Jan 05 11:40:42 2018 +0530
@@ -5831,6 +5831,10 @@
 
     push(@$contentRef, "    ${className}(JSC::JSObject*, JSDOMGlobalObject*);\n\n");
 
+    if ($interfaceOrCallback->extendedAttributes->{IsWeakCallback}) {
+        push(@$contentRef, "    bool hasCallback() const final { return m_data && m_data->callback(); }\n\n");
+    }
+
     push(@$contentRef, "    virtual void visitJSFunction(JSC::SlotVisitor&) override;\n\n") if $interfaceOrCallback->extendedAttributes->{IsWeakCallback};
 
     push(@$contentRef, "    ${callbackDataType}* m_data;\n");
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/Element.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/Element.h	Fri Jan 05 11:40:42 2018 +0530
@@ -173,7 +173,7 @@
 
     WEBCORE_EXPORT IntRect boundsInRootViewSpace();
 
-    FloatRect boundingClientRect();
+    WEBCORE_EXPORT FloatRect boundingClientRect();
 
     WEBCORE_EXPORT Ref<DOMRectList> getClientRects();
     Ref<DOMRect> getBoundingClientRect();
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationCallback.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationCallback.h	Fri Jan 05 11:40:42 2018 +0530
@@ -45,6 +45,8 @@
 public:
     using ActiveDOMCallback::ActiveDOMCallback;
 
+    virtual bool hasCallback() const = 0;
+
     virtual CallbackResult<void> handleEvent(MutationObserver&, const Vector<Ref<MutationRecord>>&, MutationObserver&) = 0;
 };
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserver.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserver.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -232,6 +232,8 @@
     Vector<Ref<MutationRecord>> records;
     records.swap(m_records);
 
+    // FIXME: Keep mutation observer callback as long as its observed nodes are alive. See https://webkit.org/b/179224.
+    if (m_callback->hasCallback())
     m_callback->handleEvent(*this, records, *this);
 }
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserverInterestGroup.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserverInterestGroup.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -37,7 +37,7 @@
 
 namespace WebCore {
 
-inline MutationObserverInterestGroup::MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>&& observers, MutationRecordDeliveryOptions oldValueFlag)
+inline MutationObserverInterestGroup::MutationObserverInterestGroup(HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions>&& observers, MutationRecordDeliveryOptions oldValueFlag)
     : m_observers(WTFMove(observers))
     , m_oldValueFlag(oldValueFlag)
 {
@@ -67,9 +67,9 @@
 {
     RefPtr<MutationRecord> mutationWithNullOldValue;
     for (auto& observerOptionsPair : m_observers) {
-        MutationObserver* observer = observerOptionsPair.key;
+        auto& observer = observerOptionsPair.key.get();
         if (hasOldValue(observerOptionsPair.value)) {
-            observer->enqueueMutationRecord(mutation.copyRef());
+            observer.enqueueMutationRecord(mutation.copyRef());
             continue;
         }
         if (!mutationWithNullOldValue) {
@@ -78,7 +78,7 @@
             else
                 mutationWithNullOldValue = MutationRecord::createWithNullOldValue(mutation).ptr();
         }
-        observer->enqueueMutationRecord(*mutationWithNullOldValue);
+        observer.enqueueMutationRecord(*mutationWithNullOldValue);
     }
 }
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserverInterestGroup.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/MutationObserverInterestGroup.h	Fri Jan 05 11:40:42 2018 +0530
@@ -42,7 +42,7 @@
 class MutationObserverInterestGroup {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>&&, MutationRecordDeliveryOptions);
+    MutationObserverInterestGroup(HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions>&&, MutationRecordDeliveryOptions);
 
     static std::unique_ptr<MutationObserverInterestGroup> createForChildListMutation(Node& target)
     {
@@ -77,7 +77,7 @@
 
     bool hasOldValue(MutationRecordDeliveryOptions options) const { return options & m_oldValueFlag; }
 
-    HashMap<MutationObserver*, MutationRecordDeliveryOptions> m_observers;
+    HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions> m_observers;
     MutationRecordDeliveryOptions m_oldValueFlag;
 };
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/NativeNodeFilter.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/NativeNodeFilter.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -34,6 +34,11 @@
 {
 }
 
+bool NativeNodeFilter::hasCallback() const
+{
+    return true;
+}
+
 CallbackResult<unsigned short> NativeNodeFilter::acceptNode(Node& node)
 {
     return m_condition->acceptNode(node);
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/NativeNodeFilter.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/NativeNodeFilter.h	Fri Jan 05 11:40:42 2018 +0530
@@ -43,6 +43,8 @@
 private:
     WEBCORE_EXPORT explicit NativeNodeFilter(ScriptExecutionContext*, Ref<NodeFilterCondition>&&);
 
+    bool hasCallback() const final;
+
     Ref<NodeFilterCondition> m_condition;
 };
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/Node.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/Node.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -2262,7 +2262,7 @@
     return &data->transientRegistry;
 }
 
-template<typename Registry> static inline void collectMatchingObserversForMutation(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, Registry* registry, Node& target, MutationObserver::MutationType type, const QualifiedName* attributeName)
+template<typename Registry> static inline void collectMatchingObserversForMutation(HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions>& observers, Registry* registry, Node& target, MutationObserver::MutationType type, const QualifiedName* attributeName)
 {
     if (!registry)
         return;
@@ -2270,16 +2270,16 @@
     for (auto& registration : *registry) {
         if (registration->shouldReceiveMutationFrom(target, type, attributeName)) {
             auto deliveryOptions = registration->deliveryOptions();
-            auto result = observers.add(&registration->observer(), deliveryOptions);
+            auto result = observers.add(registration->observer(), deliveryOptions);
             if (!result.isNewEntry)
                 result.iterator->value |= deliveryOptions;
         }
     }
 }
 
-HashMap<MutationObserver*, MutationRecordDeliveryOptions> Node::registeredMutationObservers(MutationObserver::MutationType type, const QualifiedName* attributeName)
+HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions> Node::registeredMutationObservers(MutationObserver::MutationType type, const QualifiedName* attributeName)
 {
-    HashMap<MutationObserver*, MutationRecordDeliveryOptions> result;
+    HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions> result;
     ASSERT((type == MutationObserver::Attributes && attributeName) || !attributeName);
     collectMatchingObserversForMutation(result, mutationObserverRegistry(), *this, type, attributeName);
     collectMatchingObserversForMutation(result, transientMutationObserverRegistry(), *this, type, attributeName);
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/Node.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/Node.h	Fri Jan 05 11:40:42 2018 +0530
@@ -534,7 +534,7 @@
     EventTargetData* eventTargetDataConcurrently() final;
     EventTargetData& ensureEventTargetData() final;
 
-    HashMap<MutationObserver*, MutationRecordDeliveryOptions> registeredMutationObservers(MutationObserver::MutationType, const QualifiedName* attributeName);
+    HashMap<Ref<MutationObserver>, MutationRecordDeliveryOptions> registeredMutationObservers(MutationObserver::MutationType, const QualifiedName* attributeName);
     void registerMutationObserver(MutationObserver&, MutationObserverOptions, const HashSet<AtomicString>& attributeFilter);
     void unregisterMutationObserver(MutationObserverRegistration&);
     void registerTransientMutationObserver(MutationObserverRegistration&);
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/NodeFilter.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/NodeFilter.h	Fri Jan 05 11:40:42 2018 +0530
@@ -38,6 +38,8 @@
 
     virtual CallbackResult<unsigned short> acceptNode(Node&) = 0;
 
+    virtual bool hasCallback() const = 0;
+
     /*
      * The following constants are returned by the acceptNode()
      * method:
--- a/modules/javafx.web/src/main/native/Source/WebCore/dom/TreeScope.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/dom/TreeScope.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -298,13 +298,14 @@
 
 static std::optional<LayoutPoint> absolutePointIfNotClipped(Document& document, const LayoutPoint& clientPoint)
 {
-    auto* frame = document.frame();
-    auto* view = document.view();
-    if (!frame || !view)
+    if (!document.frame() || !document.view())
         return std::nullopt;
 
-    if (frame->settings().visualViewportEnabled()) {
+    if (document.frame()->settings().visualViewportEnabled()) {
         document.updateLayout();
+        if (!document.view() || !document.hasLivingRenderTree())
+            return std::nullopt;
+        auto* view = document.view();
         FloatPoint layoutViewportPoint = view->clientToLayoutViewportPoint(clientPoint);
         FloatRect layoutViewportBounds({ }, view->layoutViewportRect().size());
         if (!layoutViewportBounds.contains(layoutViewportPoint))
@@ -312,6 +313,8 @@
         return LayoutPoint(view->layoutViewportToAbsolutePoint(layoutViewportPoint));
     }
 
+    auto* frame = document.frame();
+    auto* view = document.view();
     float scaleFactor = frame->pageZoomFactor() * frame->frameScaleFactor();
 
     LayoutPoint absolutePoint = clientPoint;
--- a/modules/javafx.web/src/main/native/Source/WebCore/html/parser/XSSAuditorDelegate.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/html/parser/XSSAuditorDelegate.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -36,7 +36,7 @@
 #include "HTMLParserIdioms.h"
 #include "NavigationScheduler.h"
 #include "PingLoader.h"
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/CString.h>
 
@@ -80,11 +80,11 @@
             httpBody = formData->flattenToString();
     }
 
-    auto reportDetails = InspectorObject::create();
+    auto reportDetails = JSON::Object::create();
     reportDetails->setString("request-url", xssInfo.m_originalURL);
     reportDetails->setString("request-body", httpBody);
 
-    auto reportObject = InspectorObject::create();
+    auto reportObject = JSON::Object::create();
     reportObject->setObject("xss-report", WTFMove(reportDetails));
 
     return FormData::create(reportObject->toJSONString().utf8().data());
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/CommandLineAPIHost.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/CommandLineAPIHost.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -42,11 +42,11 @@
 #include "Pasteboard.h"
 #include "Storage.h"
 #include <bindings/ScriptValue.h>
-#include <inspector/InspectorValues.h>
 #include <inspector/agents/InspectorAgent.h>
 #include <inspector/agents/InspectorConsoleAgent.h>
 #include <runtime/JSCInlines.h>
 #include <runtime/JSLock.h>
+#include <wtf/JSONValues.h>
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
 
@@ -83,7 +83,7 @@
     if (!m_inspectorAgent)
         return;
 
-    RefPtr<InspectorObject> hintsObject;
+    RefPtr<JSON::Object> hintsObject;
     if (!Inspector::toInspectorValue(state, hintsValue)->asObject(hintsObject))
         return;
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/CommandLineAPIHost.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/CommandLineAPIHost.h	Fri Jan 05 11:40:42 2018 +0530
@@ -41,8 +41,6 @@
 namespace Inspector {
 class InspectorAgent;
 class InspectorConsoleAgent;
-class InspectorObject;
-class InspectorValue;
 }
 
 namespace WebCore {
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -34,7 +34,6 @@
 #include "InstrumentingAgents.h"
 #include "MainFrame.h"
 #include "NetworkStateNotifier.h"
-#include <inspector/InspectorValues.h>
 #include <wtf/text/StringBuilder.h>
 
 using namespace Inspector;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCSSAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCSSAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -75,7 +75,7 @@
     PseudoClassVisited = 1 << 3
 };
 
-static unsigned computePseudoClassMask(const InspectorArray& pseudoClassArray)
+static unsigned computePseudoClassMask(const JSON::Array& pseudoClassArray)
 {
     static NeverDestroyed<String> active(MAKE_STATIC_STRING_IMPL("active"));
     static NeverDestroyed<String> hover(MAKE_STATIC_STRING_IMPL("hover"));
@@ -717,7 +717,7 @@
         errorString = InspectorDOMAgent::toErrorString(result.releaseException());
 }
 
-void InspectorCSSAgent::setStyleText(ErrorString& errorString, const InspectorObject& fullStyleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
+void InspectorCSSAgent::setStyleText(ErrorString& errorString, const JSON::Object& fullStyleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result)
 {
     InspectorCSSId compoundId(fullStyleId);
     ASSERT(!compoundId.isEmpty());
@@ -735,7 +735,7 @@
     result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
 }
 
-void InspectorCSSAgent::setRuleSelector(ErrorString& errorString, const InspectorObject& fullRuleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
+void InspectorCSSAgent::setRuleSelector(ErrorString& errorString, const JSON::Object& fullRuleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result)
 {
     InspectorCSSId compoundId(fullRuleId);
     ASSERT(!compoundId.isEmpty());
@@ -877,7 +877,7 @@
     fontFamilyNames = WTFMove(families);
 }
 
-void InspectorCSSAgent::forcePseudoState(ErrorString& errorString, int nodeId, const InspectorArray& forcedPseudoClasses)
+void InspectorCSSAgent::forcePseudoState(ErrorString& errorString, int nodeId, const JSON::Array& forcedPseudoClasses)
 {
     Element* element = m_domAgent->assertElement(errorString, nodeId);
     if (!element)
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCSSAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCSSAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -32,9 +32,9 @@
 #include "InspectorWebAgentBase.h"
 #include "SecurityContext.h"
 #include <inspector/InspectorBackendDispatchers.h>
-#include <inspector/InspectorValues.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
+#include <wtf/JSONValues.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
@@ -112,13 +112,13 @@
     void getStyleSheet(ErrorString&, const String& styleSheetId, RefPtr<Inspector::Protocol::CSS::CSSStyleSheetBody>& result) override;
     void getStyleSheetText(ErrorString&, const String& styleSheetId, String* result) override;
     void setStyleSheetText(ErrorString&, const String& styleSheetId, const String& text) override;
-    void setStyleText(ErrorString&, const Inspector::InspectorObject& styleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
-    void setRuleSelector(ErrorString&, const Inspector::InspectorObject& ruleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
+    void setStyleText(ErrorString&, const JSON::Object& styleId, const String& text, RefPtr<Inspector::Protocol::CSS::CSSStyle>& result) override;
+    void setRuleSelector(ErrorString&, const JSON::Object& ruleId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
     void createStyleSheet(ErrorString&, const String& frameId, String* styleSheetId) override;
     void addRule(ErrorString&, const String& styleSheetId, const String& selector, RefPtr<Inspector::Protocol::CSS::CSSRule>& result) override;
     void getSupportedCSSProperties(ErrorString&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSPropertyInfo>>& result) override;
     void getSupportedSystemFontFamilyNames(ErrorString&, RefPtr<Inspector::Protocol::Array<String>>& result) override;
-    void forcePseudoState(ErrorString&, int nodeId, const Inspector::InspectorArray& forcedPseudoClasses) override;
+    void forcePseudoState(ErrorString&, int nodeId, const JSON::Array& forcedPseudoClasses) override;
     void getNamedFlowCollection(ErrorString&, int documentNodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::NamedFlow>>& result) override;
 
 private:
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCanvas.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCanvas.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -112,7 +112,7 @@
     }
 
     if (!m_currentActions) {
-        m_currentActions = Inspector::Protocol::Array<InspectorValue>::create();
+        m_currentActions = Inspector::Protocol::Array<JSON::Value>::create();
 
         auto frame = Inspector::Protocol::Recording::Frame::create()
             .setActions(m_currentActions)
@@ -126,7 +126,7 @@
     m_currentActions->addItem(WTFMove(action));
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>>&& InspectorCanvas::releaseData()
+RefPtr<Inspector::Protocol::Array<JSON::Value>>&& InspectorCanvas::releaseData()
 {
     m_indexedDuplicateData.clear();
     return WTFMove(m_serializedDuplicateData);
@@ -234,9 +234,9 @@
     }
 
     if (!m_serializedDuplicateData)
-        m_serializedDuplicateData = Inspector::Protocol::Array<InspectorValue>::create();
+        m_serializedDuplicateData = Inspector::Protocol::Array<JSON::Value>::create();
 
-    RefPtr<InspectorValue> item;
+    RefPtr<JSON::Value> item;
     WTF::switchOn(data,
         [&] (const HTMLImageElement* imageElement) {
             String dataURL = ASCIILiteral("data:,");
@@ -250,7 +250,7 @@
                 }
             }
 
-            item = InspectorValue::create(dataURL);
+            item = JSON::Value::create(dataURL);
         },
 #if ENABLE(VIDEO)
         [&] (HTMLVideoElement* videoElement) {
@@ -264,7 +264,7 @@
                 dataURL = imageBuffer->toDataURL("image/png");
             }
 
-            item = InspectorValue::create(dataURL);
+            item = JSON::Value::create(dataURL);
         },
 #endif
         [&] (HTMLCanvasElement* canvasElement) {
@@ -274,7 +274,7 @@
             if (!result.hasException())
                 dataURL = result.releaseReturnValue().string;
 
-            item = InspectorValue::create(dataURL);
+            item = JSON::Value::create(dataURL);
         },
         [&] (const CanvasGradient* canvasGradient) { item = buildArrayForCanvasGradient(*canvasGradient); },
         [&] (const CanvasPattern* canvasPattern) { item = buildArrayForCanvasPattern(*canvasPattern); },
@@ -287,7 +287,7 @@
             array->addItem(static_cast<int>(scriptCallFrame.columnNumber()));
             item = WTFMove(array);
         },
-        [&] (const String& value) { item = InspectorValue::create(value); }
+        [&] (const String& value) { item = JSON::Value::create(value); }
     );
 
     m_bufferUsed += item->memoryCost();
@@ -325,11 +325,11 @@
     RefPtr<Inspector::Protocol::Recording::InitialState> initialState = Inspector::Protocol::Recording::InitialState::create()
         .release();
 
-    auto attributes = InspectorObject::create();
+    auto attributes = JSON::Object::create();
     attributes->setInteger(ASCIILiteral("width"), canvas().width());
     attributes->setInteger(ASCIILiteral("height"), canvas().height());
 
-    auto parameters = Inspector::Protocol::Array<InspectorValue>::create();
+    auto parameters = Inspector::Protocol::Array<JSON::Value>::create();
 
     const CanvasRenderingContext* canvasRenderingContext = canvas().renderingContext();
     if (is<CanvasRenderingContext2D>(canvasRenderingContext)) {
@@ -350,7 +350,7 @@
 
         // The parameter to `setLineDash` is itself an array, so we need to wrap the parameters
         // list in an array to allow spreading.
-        auto setLineDash = Inspector::Protocol::Array<InspectorValue>::create();
+        auto setLineDash = Inspector::Protocol::Array<JSON::Value>::create();
         setLineDash->addItem(buildArrayForVector(state.lineDash));
         attributes->setArray(ASCIILiteral("setLineDash"), WTFMove(setLineDash));
 
@@ -381,7 +381,7 @@
         attributes->setBoolean(ASCIILiteral("imageSmoothingEnabled"), context2d->imageSmoothingEnabled());
         attributes->setInteger(ASCIILiteral("imageSmoothingQuality"), indexForData(CanvasRenderingContext2D::stringForImageSmoothingQuality(context2d->imageSmoothingQuality())));
 
-        auto setPath = Inspector::Protocol::Array<InspectorValue>::create();
+        auto setPath = Inspector::Protocol::Array<JSON::Value>::create();
         setPath->addItem(indexForData(buildStringFromPath(context2d->getPath()->path())));
         attributes->setArray(ASCIILiteral("setPath"), WTFMove(setPath));
     }
@@ -400,12 +400,12 @@
     return initialState;
 }
 
-RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> InspectorCanvas::buildAction(const String& name, Vector<RecordCanvasActionVariant>&& parameters)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildAction(const String& name, Vector<RecordCanvasActionVariant>&& parameters)
 {
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> action = Inspector::Protocol::Array<InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> action = Inspector::Protocol::Array<JSON::Value>::create();
     action->addItem(indexForData(name));
 
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> parametersData = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> parametersData = Inspector::Protocol::Array<JSON::Value>::create();
     for (RecordCanvasActionVariant& item : parameters) {
         WTF::switchOn(item,
             [&] (const CanvasRenderingContext2D::WindingRule& value) {
@@ -480,7 +480,7 @@
     return action;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForCanvasGradient(const CanvasGradient& canvasGradient)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForCanvasGradient(const CanvasGradient& canvasGradient)
 {
     const Gradient& gradient = canvasGradient.gradient();
     bool isRadial = gradient.isRadial();
@@ -497,22 +497,22 @@
     if (isRadial)
         parameters->addItem(gradient.endRadius());
 
-    RefPtr<Inspector::Protocol::Array<InspectorValue>> stops = Inspector::Protocol::Array<InspectorValue>::create();
-    for (const Gradient::ColorStop& colorStop : gradient.stops()) {
-        RefPtr<Inspector::Protocol::Array<InspectorValue>> stop = Inspector::Protocol::Array<InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> stops = Inspector::Protocol::Array<JSON::Value>::create();
+    for (auto& colorStop : gradient.stops()) {
+        RefPtr<Inspector::Protocol::Array<JSON::Value>> stop = Inspector::Protocol::Array<JSON::Value>::create();
         stop->addItem(colorStop.offset);
         stop->addItem(indexForData(colorStop.color.cssText()));
         stops->addItem(WTFMove(stop));
     }
 
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(indexForData(type));
     array->addItem(WTFMove(parameters));
     array->addItem(WTFMove(stops));
     return array;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForCanvasPattern(const CanvasPattern& canvasPattern)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForCanvasPattern(const CanvasPattern& canvasPattern)
 {
     Image& tileImage = canvasPattern.pattern().tileImage();
     std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(tileImage.size(), RenderingMode::Unaccelerated);
@@ -530,20 +530,20 @@
     else
         repeat = ASCIILiteral("no-repeat");
 
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(indexForData("pattern"));
     array->addItem(indexForData(imageBuffer->toDataURL("image/png")));
     array->addItem(indexForData(repeat));
     return array;
 }
 
-RefPtr<Inspector::Protocol::Array<InspectorValue>> InspectorCanvas::buildArrayForImageData(const ImageData& imageData)
+RefPtr<Inspector::Protocol::Array<JSON::Value>> InspectorCanvas::buildArrayForImageData(const ImageData& imageData)
 {
     RefPtr<Inspector::Protocol::Array<int>> data = Inspector::Protocol::Array<int>::create();
     for (size_t i = 0; i < imageData.data()->length(); ++i)
         data->addItem(imageData.data()->item(i));
 
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> array = Inspector::Protocol::Array<Inspector::InspectorValue>::create();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> array = Inspector::Protocol::Array<JSON::Value>::create();
     array->addItem(WTFMove(data));
     array->addItem(imageData.width());
     array->addItem(imageData.height());
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCanvas.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorCanvas.h	Fri Jan 05 11:40:42 2018 +0530
@@ -27,7 +27,6 @@
 
 #include "CallTracerTypes.h"
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
 #include <inspector/ScriptCallFrame.h>
 #include <wtf/HashMap.h>
 #include <wtf/Ref.h>
@@ -62,7 +61,7 @@
 
     RefPtr<Inspector::Protocol::Recording::InitialState>&& releaseInitialState() { return WTFMove(m_initialState); }
     RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Recording::Frame>>&& releaseFrames() { return WTFMove(m_frames); }
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>>&& releaseData();
+    RefPtr<Inspector::Protocol::Array<JSON::Value>>&& releaseData();
 
     void markNewFrame();
     void markCurrentFrameIncomplete();
@@ -95,10 +94,10 @@
 
     int indexForData(DuplicateDataVariant);
     RefPtr<Inspector::Protocol::Recording::InitialState> buildInitialState();
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildAction(const String&, Vector<RecordCanvasActionVariant>&& = { });
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForCanvasGradient(const CanvasGradient&);
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForCanvasPattern(const CanvasPattern&);
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> buildArrayForImageData(const ImageData&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildAction(const String&, Vector<RecordCanvasActionVariant>&& = { });
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForCanvasGradient(const CanvasGradient&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForCanvasPattern(const CanvasPattern&);
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> buildArrayForImageData(const ImageData&);
 
     String m_identifier;
     HTMLCanvasElement& m_canvas;
@@ -106,8 +105,8 @@
 
     RefPtr<Inspector::Protocol::Recording::InitialState> m_initialState;
     RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Recording::Frame>> m_frames;
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> m_currentActions;
-    RefPtr<Inspector::Protocol::Array<Inspector::InspectorValue>> m_serializedDuplicateData;
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> m_currentActions;
+    RefPtr<Inspector::Protocol::Array<JSON::Value>> m_serializedDuplicateData;
     Vector<DuplicateDataVariant> m_indexedDuplicateData;
     size_t m_bufferLimit { 100 * 1024 * 1024 };
     size_t m_bufferUsed { 0 };
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -112,7 +112,7 @@
 static const size_t maxTextSize = 10000;
 static const UChar ellipsisUChar[] = { 0x2026, 0 };
 
-static Color parseColor(const InspectorObject* colorObject)
+static Color parseColor(const JSON::Object* colorObject)
 {
     if (!colorObject)
         return Color::transparent;
@@ -136,15 +136,15 @@
     return Color(r, g, b, static_cast<int>(a * 255));
 }
 
-static Color parseConfigColor(const String& fieldName, const InspectorObject* configObject)
+static Color parseConfigColor(const String& fieldName, const JSON::Object* configObject)
 {
-    RefPtr<InspectorObject> colorObject;
+    RefPtr<JSON::Object> colorObject;
     configObject->getObject(fieldName, colorObject);
 
     return parseColor(colorObject.get());
 }
 
-static bool parseQuad(const InspectorArray& quadArray, FloatQuad* quad)
+static bool parseQuad(const JSON::Array& quadArray, FloatQuad* quad)
 {
     const size_t coordinatesInQuad = 8;
     double coordinates[coordinatesInQuad];
@@ -873,7 +873,7 @@
     axProperties = buildObjectForAccessibilityProperties(node);
 }
 
-void InspectorDOMAgent::performSearch(ErrorString& errorString, const String& whitespaceTrimmedQuery, const InspectorArray* nodeIds, String* searchId, int* resultCount)
+void InspectorDOMAgent::performSearch(ErrorString& errorString, const String& whitespaceTrimmedQuery, const JSON::Array* nodeIds, String* searchId, int* resultCount)
 {
     // FIXME: Search works with node granularity - number of matches within node is not calculated.
     InspectorNodeFinder finder(whitespaceTrimmedQuery);
@@ -1017,7 +1017,7 @@
         m_overlay->highlightNode(node, *m_inspectModeHighlightConfig);
 }
 
-void InspectorDOMAgent::setSearchingForNode(ErrorString& errorString, bool enabled, const InspectorObject* highlightInspectorObject)
+void InspectorDOMAgent::setSearchingForNode(ErrorString& errorString, bool enabled, const JSON::Object* highlightInspectorObject)
 {
     if (m_searchingForNode == enabled)
         return;
@@ -1038,7 +1038,7 @@
         client->elementSelectionChanged(m_searchingForNode);
 }
 
-std::unique_ptr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString& errorString, const InspectorObject* highlightInspectorObject)
+std::unique_ptr<HighlightConfig> InspectorDOMAgent::highlightConfigFromInspectorObject(ErrorString& errorString, const JSON::Object* highlightInspectorObject)
 {
     if (!highlightInspectorObject) {
         errorString = ASCIILiteral("Internal error: highlight configuration parameter is missing");
@@ -1057,18 +1057,18 @@
     return highlightConfig;
 }
 
-void InspectorDOMAgent::setInspectModeEnabled(ErrorString& errorString, bool enabled, const InspectorObject* highlightConfig)
+void InspectorDOMAgent::setInspectModeEnabled(ErrorString& errorString, bool enabled, const JSON::Object* highlightConfig)
 {
     setSearchingForNode(errorString, enabled, highlightConfig ? highlightConfig : nullptr);
 }
 
-void InspectorDOMAgent::highlightRect(ErrorString&, int x, int y, int width, int height, const InspectorObject* color, const InspectorObject* outlineColor, const bool* usePageCoordinates)
+void InspectorDOMAgent::highlightRect(ErrorString&, int x, int y, int width, int height, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates)
 {
     auto quad = std::make_unique<FloatQuad>(FloatRect(x, y, width, height));
     innerHighlightQuad(WTFMove(quad), color, outlineColor, usePageCoordinates);
 }
 
-void InspectorDOMAgent::highlightQuad(ErrorString& errorString, const InspectorArray& quadArray, const InspectorObject* color, const InspectorObject* outlineColor, const bool* usePageCoordinates)
+void InspectorDOMAgent::highlightQuad(ErrorString& errorString, const JSON::Array& quadArray, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates)
 {
     auto quad = std::make_unique<FloatQuad>();
     if (!parseQuad(quadArray, quad.get())) {
@@ -1078,7 +1078,7 @@
     innerHighlightQuad(WTFMove(quad), color, outlineColor, usePageCoordinates);
 }
 
-void InspectorDOMAgent::innerHighlightQuad(std::unique_ptr<FloatQuad> quad, const InspectorObject* color, const InspectorObject* outlineColor, const bool* usePageCoordinates)
+void InspectorDOMAgent::innerHighlightQuad(std::unique_ptr<FloatQuad> quad, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates)
 {
     auto highlightConfig = std::make_unique<HighlightConfig>();
     highlightConfig->content = parseColor(color);
@@ -1087,7 +1087,7 @@
     m_overlay->highlightQuad(WTFMove(quad), *highlightConfig);
 }
 
-void InspectorDOMAgent::highlightSelector(ErrorString& errorString, const InspectorObject& highlightInspectorObject, const String& selectorString, const String* frameId)
+void InspectorDOMAgent::highlightSelector(ErrorString& errorString, const JSON::Object& highlightInspectorObject, const String& selectorString, const String* frameId)
 {
     RefPtr<Document> document;
 
@@ -1121,7 +1121,7 @@
     m_overlay->highlightNodeList(queryResult.releaseReturnValue(), *highlightConfig);
 }
 
-void InspectorDOMAgent::highlightNode(ErrorString& errorString, const InspectorObject& highlightInspectorObject, const int* nodeId, const String* objectId)
+void InspectorDOMAgent::highlightNode(ErrorString& errorString, const JSON::Object& highlightInspectorObject, const int* nodeId, const String* objectId)
 {
     Node* node = nullptr;
     if (nodeId)
@@ -1143,7 +1143,7 @@
     m_overlay->highlightNode(node, *highlightConfig);
 }
 
-void InspectorDOMAgent::highlightNodeList(ErrorString& errorString, const InspectorArray& nodeIds, const InspectorObject& highlightInspectorObject)
+void InspectorDOMAgent::highlightNodeList(ErrorString& errorString, const JSON::Array& nodeIds, const JSON::Object& highlightInspectorObject)
 {
     Vector<Ref<Node>> nodes;
     for (auto& nodeValue : nodeIds) {
@@ -1177,7 +1177,7 @@
     m_overlay->highlightNodeList(StaticNodeList::create(WTFMove(nodes)), *highlightConfig);
 }
 
-void InspectorDOMAgent::highlightFrame(ErrorString& errorString, const String& frameId, const InspectorObject* color, const InspectorObject* outlineColor)
+void InspectorDOMAgent::highlightFrame(ErrorString& errorString, const String& frameId, const JSON::Object* color, const JSON::Object* outlineColor)
 {
     Frame* frame = m_pageAgent->assertFrame(errorString, frameId);
     if (!frame)
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -33,9 +33,9 @@
 #include "InspectorWebAgentBase.h"
 #include <inspector/InspectorBackendDispatchers.h>
 #include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
+#include <wtf/JSONValues.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/AtomicString.h>
@@ -124,23 +124,23 @@
     void setNodeValue(ErrorString&, int nodeId, const String& value) override;
     void getEventListenersForNode(ErrorString&, int nodeId, const WTF::String* const objectGroup, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::EventListener>>& listenersArray) override;
     void getAccessibilityPropertiesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::DOM::AccessibilityProperties>& axProperties) override;
-    void performSearch(ErrorString&, const String& whitespaceTrimmedQuery, const Inspector::InspectorArray* nodeIds, String* searchId, int* resultCount) override;
+    void performSearch(ErrorString&, const String& whitespaceTrimmedQuery, const JSON::Array* nodeIds, String* searchId, int* resultCount) override;
     void getSearchResults(ErrorString&, const String& searchId, int fromIndex, int toIndex, RefPtr<Inspector::Protocol::Array<int>>&) override;
     void discardSearchResults(ErrorString&, const String& searchId) override;
     void resolveNode(ErrorString&, int nodeId, const String* const objectGroup, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result) override;
     void getAttributes(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::Array<String>>& result) override;
-    void setInspectModeEnabled(ErrorString&, bool enabled, const Inspector::InspectorObject* highlightConfig) override;
+    void setInspectModeEnabled(ErrorString&, bool enabled, const JSON::Object* highlightConfig) override;
     void requestNode(ErrorString&, const String& objectId, int* nodeId) override;
     void pushNodeByPathToFrontend(ErrorString&, const String& path, int* nodeId) override;
     void pushNodeByBackendIdToFrontend(ErrorString&, BackendNodeId, int* nodeId) override;
     void releaseBackendNodeIds(ErrorString&, const String& nodeGroup) override;
     void hideHighlight(ErrorString&) override;
-    void highlightRect(ErrorString&, int x, int y, int width, int height, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* const usePageCoordinates) override;
-    void highlightQuad(ErrorString&, const Inspector::InspectorArray& quad, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* const usePageCoordinates) override;
-    void highlightSelector(ErrorString&, const Inspector::InspectorObject& highlightConfig, const String& selectorString, const String* const frameId) override;
-    void highlightNode(ErrorString&, const Inspector::InspectorObject& highlightConfig, const int* const nodeId, const String* const objectId) override;
-    void highlightNodeList(ErrorString&, const Inspector::InspectorArray& nodeIds, const Inspector::InspectorObject& highlightConfig) override;
-    void highlightFrame(ErrorString&, const String& frameId, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor) override;
+    void highlightRect(ErrorString&, int x, int y, int width, int height, const JSON::Object* color, const JSON::Object* outlineColor, const bool* const usePageCoordinates) override;
+    void highlightQuad(ErrorString&, const JSON::Array& quad, const JSON::Object* color, const JSON::Object* outlineColor, const bool* const usePageCoordinates) override;
+    void highlightSelector(ErrorString&, const JSON::Object& highlightConfig, const String& selectorString, const String* const frameId) override;
+    void highlightNode(ErrorString&, const JSON::Object& highlightConfig, const int* const nodeId, const String* const objectId) override;
+    void highlightNodeList(ErrorString&, const JSON::Array& nodeIds, const JSON::Object& highlightConfig) override;
+    void highlightFrame(ErrorString&, const String& frameId, const JSON::Object* color, const JSON::Object* outlineColor) override;
 
     void moveTo(ErrorString&, int nodeId, int targetNodeId, const int* const anchorNodeId, int* newNodeId) override;
     void undo(ErrorString&) override;
@@ -212,8 +212,8 @@
 
 private:
     void highlightMousedOverNode();
-    void setSearchingForNode(ErrorString&, bool enabled, const Inspector::InspectorObject* highlightConfig);
-    std::unique_ptr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString&, const Inspector::InspectorObject* highlightInspectorObject);
+    void setSearchingForNode(ErrorString&, bool enabled, const JSON::Object* highlightConfig);
+    std::unique_ptr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString&, const JSON::Object* highlightInspectorObject);
 
     // Node-related methods.
     typedef HashMap<RefPtr<Node>, int> NodeToIdMap;
@@ -239,7 +239,7 @@
 
     void discardBindings();
 
-    void innerHighlightQuad(std::unique_ptr<FloatQuad>, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* usePageCoordinates);
+    void innerHighlightQuad(std::unique_ptr<FloatQuad>, const JSON::Object* color, const JSON::Object* outlineColor, const bool* usePageCoordinates);
 
     Inspector::InjectedScriptManager& m_injectedScriptManager;
     std::unique_ptr<Inspector::DOMFrontendDispatcher> m_frontendDispatcher;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -37,7 +37,7 @@
 #include "InstrumentingAgents.h"
 #include <inspector/ContentSearchUtilities.h>
 #include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <yarr/RegularExpression.h>
 
 namespace {
@@ -162,7 +162,7 @@
 void InspectorDOMDebuggerAgent::didInvalidateStyleAttr(Node& node)
 {
     if (hasBreakpoint(&node, AttributeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
+        Ref<JSON::Object> eventData = JSON::Object::create();
         descriptionForDOMEvent(node, AttributeModified, false, eventData.get());
         m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
     }
@@ -265,7 +265,7 @@
         return;
 
     if (hasBreakpoint(&parent, SubtreeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
+        Ref<JSON::Object> eventData = JSON::Object::create();
         descriptionForDOMEvent(parent, SubtreeModified, true, eventData.get());
         m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
     }
@@ -278,11 +278,11 @@
 
     Node* parentNode = InspectorDOMAgent::innerParentNode(&node);
     if (hasBreakpoint(&node, NodeRemoved)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
+        Ref<JSON::Object> eventData = JSON::Object::create();
         descriptionForDOMEvent(node, NodeRemoved, false, eventData.get());
         m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
     } else if (parentNode && hasBreakpoint(parentNode, SubtreeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
+        Ref<JSON::Object> eventData = JSON::Object::create();
         descriptionForDOMEvent(node, SubtreeModified, false, eventData.get());
         m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
     }
@@ -294,13 +294,13 @@
         return;
 
     if (hasBreakpoint(&element, AttributeModified)) {
-        Ref<InspectorObject> eventData = InspectorObject::create();
+        Ref<JSON::Object> eventData = JSON::Object::create();
         descriptionForDOMEvent(element, AttributeModified, false, eventData.get());
         m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::DOM, WTFMove(eventData));
     }
 }
 
-void InspectorDOMDebuggerAgent::descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, InspectorObject& description)
+void InspectorDOMDebuggerAgent::descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, JSON::Object& description)
 {
     ASSERT(hasBreakpoint(&target, breakpointType));
 
@@ -365,7 +365,7 @@
     if (!shouldPause)
         return;
 
-    Ref<InspectorObject> eventData = InspectorObject::create();
+    Ref<JSON::Object> eventData = JSON::Object::create();
     eventData->setString(ASCIILiteral("eventName"), fullEventName);
 
     if (synchronous)
@@ -418,7 +418,7 @@
     if (breakpointURL.isNull())
         return;
 
-    Ref<InspectorObject> eventData = InspectorObject::create();
+    Ref<JSON::Object> eventData = JSON::Object::create();
     eventData->setString("breakpointURL", breakpointURL);
     eventData->setString("url", url);
     m_debuggerAgent->breakProgram(Inspector::DebuggerFrontendDispatcher::Reason::XHR, WTFMove(eventData));
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -35,12 +35,9 @@
 #include <inspector/InspectorBackendDispatchers.h>
 #include <inspector/agents/InspectorDebuggerAgent.h>
 #include <wtf/HashMap.h>
+#include <wtf/JSONValues.h>
 #include <wtf/text/WTFString.h>
 
-namespace Inspector {
-class InspectorObject;
-}
-
 namespace WebCore {
 
 class Element;
@@ -87,7 +84,7 @@
     void debuggerWasDisabled() override;
     void disable();
 
-    void descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, Inspector::InspectorObject& description);
+    void descriptionForDOMEvent(Node& target, int breakpointType, bool insertion, JSON::Object& description);
     void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set);
     bool hasBreakpoint(Node*, int type);
     void discardBindings();
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -47,7 +47,7 @@
 #include "StorageType.h"
 #include "VoidCallback.h"
 #include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 using namespace Inspector;
 
@@ -87,7 +87,7 @@
     m_enabled = false;
 }
 
-void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString& errorString, const InspectorObject& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items)
+void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString& errorString, const JSON::Object& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items)
 {
     Frame* frame;
     RefPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, frame);
@@ -111,7 +111,7 @@
     items = WTFMove(storageItems);
 }
 
-void InspectorDOMStorageAgent::setDOMStorageItem(ErrorString& errorString, const InspectorObject& storageId, const String& key, const String& value)
+void InspectorDOMStorageAgent::setDOMStorageItem(ErrorString& errorString, const JSON::Object& storageId, const String& key, const String& value)
 {
     Frame* frame;
     RefPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, frame);
@@ -126,7 +126,7 @@
         errorString = DOMException::name(QuotaExceededError);
 }
 
-void InspectorDOMStorageAgent::removeDOMStorageItem(ErrorString& errorString, const InspectorObject& storageId, const String& key)
+void InspectorDOMStorageAgent::removeDOMStorageItem(ErrorString& errorString, const JSON::Object& storageId, const String& key)
 {
     Frame* frame;
     RefPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, frame);
@@ -174,7 +174,7 @@
         m_frontendDispatcher->domStorageItemUpdated(id, key, oldValue, newValue);
 }
 
-RefPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(ErrorString& errorString, const InspectorObject& storageId, Frame*& targetFrame)
+RefPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(ErrorString& errorString, const JSON::Object& storageId, Frame*& targetFrame)
 {
     String securityOrigin;
     bool isLocalStorage = false;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMStorageAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDOMStorageAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -60,9 +60,9 @@
     // Called from the front-end.
     void enable(ErrorString&) override;
     void disable(ErrorString&) override;
-    void getDOMStorageItems(ErrorString&, const Inspector::InspectorObject& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items) override;
-    void setDOMStorageItem(ErrorString&, const Inspector::InspectorObject& storageId, const String& key, const String& value) override;
-    void removeDOMStorageItem(ErrorString&, const Inspector::InspectorObject& storageId, const String& key) override;
+    void getDOMStorageItems(ErrorString&, const JSON::Object& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items) override;
+    void setDOMStorageItem(ErrorString&, const JSON::Object& storageId, const String& key, const String& value) override;
+    void removeDOMStorageItem(ErrorString&, const JSON::Object& storageId, const String& key) override;
 
     // Called from the injected script.
     String storageId(Storage&);
@@ -72,7 +72,7 @@
     void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
 
 private:
-    RefPtr<StorageArea> findStorageArea(ErrorString&, const Inspector::InspectorObject&, Frame*&);
+    RefPtr<StorageArea> findStorageArea(ErrorString&, const JSON::Object&, Frame*&);
 
     std::unique_ptr<Inspector::DOMStorageFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::DOMStorageBackendDispatcher> m_backendDispatcher;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDatabaseAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDatabaseAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -44,7 +44,7 @@
 #include "SQLValue.h"
 #include "VoidCallback.h"
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/Vector.h>
 
 using namespace Inspector;
@@ -86,12 +86,12 @@
         for (auto& column : rowList.columnNames())
             columnNames->addItem(column);
 
-        auto values = Inspector::Protocol::Array<InspectorValue>::create();
+        auto values = Inspector::Protocol::Array<JSON::Value>::create();
         for (auto& value : rowList.values()) {
             auto inspectorValue = WTF::switchOn(value,
-                [] (const std::nullptr_t&) { return InspectorValue::null(); },
-                [] (const String& string) { return InspectorValue::create(string); },
-                [] (double number) { return InspectorValue::create(number); }
+                [] (const std::nullptr_t&) { return JSON::Value::null(); },
+                [] (const String& string) { return JSON::Value::create(string); },
+                [] (double number) { return JSON::Value::create(number); }
             );
             values->addItem(WTFMove(inspectorValue));
         }
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDatabaseResource.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorDatabaseResource.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -32,7 +32,6 @@
 #include "InspectorDatabaseResource.h"
 
 #include "Database.h"
-#include <inspector/InspectorValues.h>
 
 using namespace Inspector;
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -65,7 +65,7 @@
 #include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorFrontendDispatchers.h>
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/Vector.h>
 
@@ -268,7 +268,7 @@
     Ref<RequestDatabaseCallback> m_requestCallback;
 };
 
-static RefPtr<IDBKey> idbKeyFromInspectorObject(InspectorObject* key)
+static RefPtr<IDBKey> idbKeyFromInspectorObject(JSON::Object* key)
 {
     String type;
     if (!key->getString("type", type))
@@ -297,12 +297,12 @@
         idbKey = IDBKey::createDate(date);
     } else if (type == arrayType) {
         Vector<RefPtr<IDBKey>> keyArray;
-        RefPtr<InspectorArray> array;
+        RefPtr<JSON::Array> array;
         if (!key->getArray("array", array))
             return nullptr;
         for (size_t i = 0; i < array->length(); ++i) {
-            RefPtr<InspectorValue> value = array->get(i);
-            RefPtr<InspectorObject> object;
+            RefPtr<JSON::Value> value = array->get(i);
+            RefPtr<JSON::Object> object;
             if (!value->asObject(object))
                 return nullptr;
             keyArray.append(idbKeyFromInspectorObject(object.get()));
@@ -314,10 +314,10 @@
     return idbKey;
 }
 
-static RefPtr<IDBKeyRange> idbKeyRangeFromKeyRange(const InspectorObject* keyRange)
+static RefPtr<IDBKeyRange> idbKeyRangeFromKeyRange(const JSON::Object* keyRange)
 {
     RefPtr<IDBKey> idbLower;
-    RefPtr<InspectorObject> lower;
+    RefPtr<JSON::Object> lower;
     if (keyRange->getObject(ASCIILiteral("lower"), lower)) {
         idbLower = idbKeyFromInspectorObject(lower.get());
         if (!idbLower)
@@ -325,7 +325,7 @@
     }
 
     RefPtr<IDBKey> idbUpper;
-    RefPtr<InspectorObject> upper;
+    RefPtr<JSON::Object> upper;
     if (keyRange->getObject(ASCIILiteral("upper"), upper)) {
         idbUpper = idbKeyFromInspectorObject(upper.get());
         if (!idbUpper)
@@ -604,7 +604,7 @@
     databaseLoader->start(idbFactory, &document->securityOrigin(), databaseName);
 }
 
-void InspectorIndexedDBAgent::requestData(ErrorString& errorString, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const InspectorObject* keyRange, Ref<RequestDataCallback>&& requestCallback)
+void InspectorIndexedDBAgent::requestData(ErrorString& errorString, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const JSON::Object* keyRange, Ref<RequestDataCallback>&& requestCallback)
 {
     Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin);
     Document* document = assertDocument(errorString, frame);
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorIndexedDBAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorIndexedDBAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -61,7 +61,7 @@
     void disable(ErrorString&) override;
     void requestDatabaseNames(ErrorString&, const String& securityOrigin, Ref<RequestDatabaseNamesCallback>&&) override;
     void requestDatabase(ErrorString&, const String& securityOrigin, const String& databaseName, Ref<RequestDatabaseCallback>&&) override;
-    void requestData(ErrorString&, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const Inspector::InspectorObject* keyRange, Ref<RequestDataCallback>&&) override;
+    void requestData(ErrorString&, const String& securityOrigin, const String& databaseName, const String& objectStoreName, const String& indexName, int skipCount, int pageSize, const JSON::Object* keyRange, Ref<RequestDataCallback>&&) override;
     void clearObjectStore(ErrorString&, const String& in_securityOrigin, const String& in_databaseName, const String& in_objectStoreName, Ref<ClearObjectStoreCallback>&&) override;
 
 private:
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorNetworkAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorNetworkAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -69,10 +69,10 @@
 #include <inspector/InjectedScript.h>
 #include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorFrontendRouter.h>
-#include <inspector/InspectorValues.h>
 #include <inspector/ScriptCallStack.h>
 #include <inspector/ScriptCallStackFactory.h>
 #include <runtime/JSCInlines.h>
+#include <wtf/JSONValues.h>
 #include <wtf/Lock.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Stopwatch.h>
@@ -178,9 +178,9 @@
     disable(unused);
 }
 
-static Ref<InspectorObject> buildObjectForHeaders(const HTTPHeaderMap& headers)
+static Ref<JSON::Object> buildObjectForHeaders(const HTTPHeaderMap& headers)
 {
-    Ref<InspectorObject> headersObject = InspectorObject::create();
+    Ref<JSON::Object> headersObject = JSON::Object::create();
 
     for (const auto& header : headers)
         headersObject->setString(header.key, header.value);
@@ -288,7 +288,7 @@
         return nullptr;
 
     double status = response.httpStatusCode();
-    Ref<InspectorObject> headers = buildObjectForHeaders(response.httpHeaderFields());
+    Ref<JSON::Object> headers = buildObjectForHeaders(response.httpHeaderFields());
 
     auto responseObject = Inspector::Protocol::Network::Response::create()
         .setUrl(response.url().string())
@@ -702,7 +702,7 @@
     m_pageAgent->page().setResourceCachingDisabledOverride(false);
 }
 
-void InspectorNetworkAgent::setExtraHTTPHeaders(ErrorString&, const InspectorObject& headers)
+void InspectorNetworkAgent::setExtraHTTPHeaders(ErrorString&, const JSON::Object& headers)
 {
     for (auto& entry : headers) {
         String stringValue;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorNetworkAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorNetworkAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -39,7 +39,6 @@
 #include <yarr/RegularExpression.h>
 
 namespace Inspector {
-class InspectorObject;
 class InjectedScriptManager;
 }
 
@@ -106,7 +105,7 @@
     // Called from frontend.
     void enable(ErrorString&) override;
     void disable(ErrorString&) override;
-    void setExtraHTTPHeaders(ErrorString&, const Inspector::InspectorObject& headers) override;
+    void setExtraHTTPHeaders(ErrorString&, const JSON::Object& headers) override;
     void getResponseBody(ErrorString&, const String& requestId, String* content, bool* base64Encoded) override;
     void setResourceCachingDisabled(ErrorString&, bool disabled) override;
     void loadResource(ErrorString&, const String& frameId, const String& url, Ref<LoadResourceCallback>&&) override;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -60,7 +60,7 @@
 #include "SocketProvider.h"
 #include "StyledElement.h"
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
+#include <wtf/JSONValues.h>
 
 using namespace Inspector;
 using namespace std::literals::chrono_literals;
@@ -925,14 +925,14 @@
     evaluateInOverlay("reset", WTFMove(configObject));
 }
 
-static void evaluateCommandInOverlay(Page* page, Ref<InspectorArray>&& command)
+static void evaluateCommandInOverlay(Page* page, Ref<JSON::Array>&& command)
 {
     page->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')')));
 }
 
 void InspectorOverlay::evaluateInOverlay(const String& method)
 {
-    Ref<InspectorArray> command = InspectorArray::create();
+    Ref<JSON::Array> command = JSON::Array::create();
     command->pushString(method);
 
     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
@@ -940,16 +940,16 @@
 
 void InspectorOverlay::evaluateInOverlay(const String& method, const String& argument)
 {
-    Ref<InspectorArray> command = InspectorArray::create();
+    Ref<JSON::Array> command = JSON::Array::create();
     command->pushString(method);
     command->pushString(argument);
 
     evaluateCommandInOverlay(overlayPage(), WTFMove(command));
 }
 
-void InspectorOverlay::evaluateInOverlay(const String& method, RefPtr<InspectorValue>&& argument)
+void InspectorOverlay::evaluateInOverlay(const String& method, RefPtr<JSON::Value>&& argument)
 {
-    Ref<InspectorArray> command = InspectorArray::create();
+    Ref<JSON::Array> command = JSON::Array::create();
     command->pushString(method);
     command->pushValue(WTFMove(argument));
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorOverlay.h	Fri Jan 05 11:40:42 2018 +0530
@@ -35,21 +35,11 @@
 #include "Timer.h"
 #include <inspector/InspectorProtocolObjects.h>
 #include <wtf/Deque.h>
+#include <wtf/JSONValues.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
-namespace Inspector {
-class InspectorObject;
-class InspectorValue;
-
-namespace Protocol {
-namespace OverlayTypes {
-class NodeHighlightData;
-}
-}
-}
-
 namespace WebCore {
 
 class Color;
@@ -151,7 +141,7 @@
     void reset(const IntSize& viewportSize, const IntSize& frameViewFullSize);
     void evaluateInOverlay(const String& method);
     void evaluateInOverlay(const String& method, const String& argument);
-    void evaluateInOverlay(const String& method, RefPtr<Inspector::InspectorValue>&& argument);
+    void evaluateInOverlay(const String& method, RefPtr<JSON::Value>&& argument);
 
     Page& m_page;
     InspectorClient* m_client;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorPageAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorPageAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -70,7 +70,6 @@
 #include "UserGestureIndicator.h"
 #include <inspector/ContentSearchUtilities.h>
 #include <inspector/IdentifiersFactory.h>
-#include <inspector/InspectorValues.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/Stopwatch.h>
 #include <wtf/text/Base64.h>
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorShaderProgram.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorShaderProgram.h	Fri Jan 05 11:40:42 2018 +0530
@@ -26,7 +26,6 @@
 #pragma once
 
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
 
 namespace WebCore {
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorStyleSheet.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorStyleSheet.h	Fri Jan 05 11:40:42 2018 +0530
@@ -27,8 +27,8 @@
 #include "CSSPropertySourceData.h"
 #include "CSSStyleDeclaration.h"
 #include <inspector/InspectorProtocolObjects.h>
-#include <inspector/InspectorValues.h>
 #include <wtf/HashMap.h>
+#include <wtf/JSONValues.h>
 #include <wtf/Vector.h>
 
 class ParsedStyleSheet;
@@ -51,7 +51,7 @@
 public:
     InspectorCSSId() { }
 
-    explicit InspectorCSSId(const Inspector::InspectorObject& value)
+    explicit InspectorCSSId(const JSON::Object& value)
     {
         if (!value.getString(ASCIILiteral("styleSheetId"), m_styleSheetId))
             return;
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorTimelineAgent.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorTimelineAgent.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -132,7 +132,7 @@
     m_autoCaptureEnabled = enabled;
 }
 
-void InspectorTimelineAgent::setInstruments(ErrorString& errorString, const InspectorArray& instruments)
+void InspectorTimelineAgent::setInstruments(ErrorString& errorString, const JSON::Array& instruments)
 {
     Vector<Protocol::Timeline::Instrument> newInstruments;
     newInstruments.reserveCapacity(instruments.length());
@@ -180,7 +180,7 @@
             return;
 
         if (!m_runLoopNestingLevel)
-            pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RenderingFrame, false, nullptr);
+            pushCurrentRecord(JSON::Object::create(), TimelineRecordType::RenderingFrame, false, nullptr);
         m_runLoopNestingLevel++;
     });
 
@@ -204,7 +204,7 @@
 
     // Create a runloop record and increment the runloop nesting level, to capture the current turn of the main runloop
     // (which is the outer runloop if recording started while paused in the debugger).
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RenderingFrame, false, nullptr);
+    pushCurrentRecord(JSON::Object::create(), TimelineRecordType::RenderingFrame, false, nullptr);
 
     m_runLoopNestingLevel = 1;
 #endif
@@ -318,12 +318,12 @@
 
 void InspectorTimelineAgent::didInvalidateLayout(Frame& frame)
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::InvalidateLayout, true, &frame);
+    appendRecord(JSON::Object::create(), TimelineRecordType::InvalidateLayout, true, &frame);
 }
 
 void InspectorTimelineAgent::willLayout(Frame& frame)
 {
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout, true, &frame);
+    pushCurrentRecord(JSON::Object::create(), TimelineRecordType::Layout, true, &frame);
 }
 
 void InspectorTimelineAgent::didLayout(RenderObject& root)
@@ -343,12 +343,12 @@
 
 void InspectorTimelineAgent::didScheduleStyleRecalculation(Frame* frame)
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::ScheduleStyleRecalculation, true, frame);
+    appendRecord(JSON::Object::create(), TimelineRecordType::ScheduleStyleRecalculation, true, frame);
 }
 
 void InspectorTimelineAgent::willRecalculateStyle(Frame* frame)
 {
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RecalculateStyles, true, frame);
+    pushCurrentRecord(JSON::Object::create(), TimelineRecordType::RecalculateStyles, true, frame);
 }
 
 void InspectorTimelineAgent::didRecalculateStyle()
@@ -359,7 +359,7 @@
 void InspectorTimelineAgent::willComposite(Frame& frame)
 {
     ASSERT(!m_startedComposite);
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Composite, true, &frame);
+    pushCurrentRecord(JSON::Object::create(), TimelineRecordType::Composite, true, &frame);
     m_startedComposite = true;
 }
 
@@ -372,7 +372,7 @@
 
 void InspectorTimelineAgent::willPaint(Frame& frame)
 {
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true, &frame);
+    pushCurrentRecord(JSON::Object::create(), TimelineRecordType::Paint, true, &frame);
 }
 
 void InspectorTimelineAgent::didPaint(RenderObject& renderer, const LayoutRect& clipRect)
@@ -662,7 +662,7 @@
     return Inspector::Protocol::Timeline::EventType::TimeStamp;
 }
 
-void InspectorTimelineAgent::addRecordToTimeline(RefPtr<InspectorObject>&& record, TimelineRecordType type)
+void InspectorTimelineAgent::addRecordToTimeline(RefPtr<JSON::Object>&& record, TimelineRecordType type)
 {
     ASSERT_ARG(record, record);
     record->setString("type", Inspector::Protocol::InspectorHelpers::getEnumConstantValue(toProtocol(type)));
@@ -680,7 +680,7 @@
     }
 }
 
-void InspectorTimelineAgent::setFrameIdentifier(InspectorObject* record, Frame* frame)
+void InspectorTimelineAgent::setFrameIdentifier(JSON::Object* record, Frame* frame)
 {
     if (!frame || !m_pageAgent)
         return;
@@ -715,29 +715,29 @@
     }
 }
 
-void InspectorTimelineAgent::appendRecord(RefPtr<InspectorObject>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame)
+void InspectorTimelineAgent::appendRecord(RefPtr<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame)
 {
-    Ref<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
+    Ref<JSON::Object> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
     record->setObject("data", WTFMove(data));
     setFrameIdentifier(&record.get(), frame);
     addRecordToTimeline(WTFMove(record), type);
 }
 
-void InspectorTimelineAgent::sendEvent(RefPtr<InspectorObject>&& event)
+void InspectorTimelineAgent::sendEvent(RefPtr<JSON::Object>&& event)
 {
     // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now.
     auto recordChecked = BindingTraits<Inspector::Protocol::Timeline::TimelineEvent>::runtimeCast(WTFMove(event));
     m_frontendDispatcher->eventRecorded(WTFMove(recordChecked));
 }
 
-InspectorTimelineAgent::TimelineRecordEntry InspectorTimelineAgent::createRecordEntry(RefPtr<InspectorObject>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame)
+InspectorTimelineAgent::TimelineRecordEntry InspectorTimelineAgent::createRecordEntry(RefPtr<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame)
 {
-    Ref<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
+    Ref<JSON::Object> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0);
     setFrameIdentifier(&record.get(), frame);
-    return TimelineRecordEntry(WTFMove(record), WTFMove(data), InspectorArray::create(), type);
+    return TimelineRecordEntry(WTFMove(record), WTFMove(data), JSON::Array::create(), type);
 }
 
-void InspectorTimelineAgent::pushCurrentRecord(RefPtr<InspectorObject>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame)
+void InspectorTimelineAgent::pushCurrentRecord(RefPtr<JSON::Object>&& data, TimelineRecordType type, bool captureCallStack, Frame* frame)
 {
     pushCurrentRecord(createRecordEntry(WTFMove(data), type, captureCallStack, frame));
 }
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorTimelineAgent.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/InspectorTimelineAgent.h	Fri Jan 05 11:40:42 2018 +0530
@@ -36,8 +36,8 @@
 #include "LayoutRect.h"
 #include <inspector/InspectorBackendDispatchers.h>
 #include <inspector/InspectorFrontendDispatchers.h>
-#include <inspector/InspectorValues.h>
 #include <inspector/ScriptDebugListener.h>
+#include <wtf/JSONValues.h>
 #include <wtf/Vector.h>
 
 namespace Inspector {
@@ -101,7 +101,7 @@
     void start(ErrorString&, const int* const maxCallStackDepth = nullptr) final;
     void stop(ErrorString&) final;
     void setAutoCaptureEnabled(ErrorString&, bool) final;
-    void setInstruments(ErrorString&, const Inspector::InspectorArray&) final;
+    void setInstruments(ErrorString&, const JSON::Array&) final;
 
     int id() const { return m_id; }
 
@@ -170,7 +170,7 @@
     struct TimelineRecordEntry {
         TimelineRecordEntry()
             : type(TimelineRecordType::EventDispatch) { }
-        TimelineRecordEntry(RefPtr<Inspector::InspectorObject>&& record, RefPtr<Inspector::InspectorObject>&& data, RefPtr<Inspector::InspectorArray>&& children, TimelineRecordType type)
+        TimelineRecordEntry(RefPtr<JSON::Object>&& record, RefPtr<JSON::Object>&& data, RefPtr<JSON::Array>&& children, TimelineRecordType type)
             : record(WTFMove(record))
             , data(WTFMove(data))
             , children(WTFMove(children))
@@ -178,9 +178,9 @@
         {
         }
 
-        RefPtr<Inspector::InspectorObject> record;
-        RefPtr<Inspector::InspectorObject> data;
-        RefPtr<Inspector::InspectorArray> children;
+        RefPtr<JSON::Object> record;
+        RefPtr<JSON::Object> data;
+        RefPtr<JSON::Array> children;
         TimelineRecordType type;
     };
 
@@ -188,19 +188,19 @@
     void internalStop();
     double timestamp();
 
-    void sendEvent(RefPtr<Inspector::InspectorObject>&&);
-    void appendRecord(RefPtr<Inspector::InspectorObject>&& data, TimelineRecordType, bool captureCallStack, Frame*);
-    void pushCurrentRecord(RefPtr<Inspector::InspectorObject>&&, TimelineRecordType, bool captureCallStack, Frame*);
+    void sendEvent(RefPtr<JSON::Object>&&);
+    void appendRecord(RefPtr<JSON::Object>&& data, TimelineRecordType, bool captureCallStack, Frame*);
+    void pushCurrentRecord(RefPtr<JSON::Object>&&, TimelineRecordType, bool captureCallStack, Frame*);
     void pushCurrentRecord(const TimelineRecordEntry& record) { m_recordStack.append(record); }
 
-    TimelineRecordEntry createRecordEntry(RefPtr<Inspector::InspectorObject>&& data, TimelineRecordType, bool captureCallStack, Frame*);
+    TimelineRecordEntry createRecordEntry(RefPtr<JSON::Object>&& data, TimelineRecordType, bool captureCallStack, Frame*);
 
-    void setFrameIdentifier(Inspector::InspectorObject* record, Frame*);
+    void setFrameIdentifier(JSON::Object* record, Frame*);
 
     void didCompleteRecordEntry(const TimelineRecordEntry&);
     void didCompleteCurrentRecord(TimelineRecordType);
 
-    void addRecordToTimeline(RefPtr<Inspector::InspectorObject>&&, TimelineRecordType);
+    void addRecordToTimeline(RefPtr<JSON::Object>&&, TimelineRecordType);
     void clearRecordStack();
 
     void localToPageQuad(const RenderObject&, const LayoutRect&, FloatQuad*);
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/TimelineRecordFactory.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/TimelineRecordFactory.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -44,9 +44,9 @@
 
 namespace WebCore {
 
-Ref<InspectorObject> TimelineRecordFactory::createGenericRecord(double startTime, int maxCallStackDepth)
+Ref<JSON::Object> TimelineRecordFactory::createGenericRecord(double startTime, int maxCallStackDepth)
 {
-    Ref<InspectorObject> record = InspectorObject::create();
+    Ref<JSON::Object> record = JSON::Object::create();
     record->setDouble(ASCIILiteral("startTime"), startTime);
 
     if (maxCallStackDepth) {
@@ -57,77 +57,77 @@
     return record;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine)
+Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setString(ASCIILiteral("scriptName"), scriptName);
     data->setInteger(ASCIILiteral("scriptLine"), scriptLine);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createConsoleProfileData(const String& title)
+Ref<JSON::Object> TimelineRecordFactory::createConsoleProfileData(const String& title)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setString(ASCIILiteral("title"), title);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createProbeSampleData(const ScriptBreakpointAction& action, unsigned sampleId)
+Ref<JSON::Object> TimelineRecordFactory::createProbeSampleData(const ScriptBreakpointAction& action, unsigned sampleId)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setInteger(ASCIILiteral("probeId"), action.identifier);
     data->setInteger(ASCIILiteral("sampleId"), sampleId);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createEventDispatchData(const Event& event)
+Ref<JSON::Object> TimelineRecordFactory::createEventDispatchData(const Event& event)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setString(ASCIILiteral("type"), event.type().string());
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createGenericTimerData(int timerId)
+Ref<JSON::Object> TimelineRecordFactory::createGenericTimerData(int timerId)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setInteger(ASCIILiteral("timerId"), timerId);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId, Seconds timeout, bool singleShot)
+Ref<JSON::Object> TimelineRecordFactory::createTimerInstallData(int timerId, Seconds timeout, bool singleShot)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setInteger(ASCIILiteral("timerId"), timerId);
     data->setInteger(ASCIILiteral("timeout"), (int)timeout.milliseconds());
     data->setBoolean(ASCIILiteral("singleShot"), singleShot);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber)
+Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setString(ASCIILiteral("url"), url);
     data->setInteger(ASCIILiteral("lineNumber"), lineNumber);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createTimeStampData(const String& message)
+Ref<JSON::Object> TimelineRecordFactory::createTimeStampData(const String& message)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setString(ASCIILiteral("message"), message);
     return data;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createAnimationFrameData(int callbackId)
+Ref<JSON::Object> TimelineRecordFactory::createAnimationFrameData(int callbackId)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setInteger(ASCIILiteral("id"), callbackId);
     return data;
 }
 
-static Ref<InspectorArray> createQuad(const FloatQuad& quad)
+static Ref<JSON::Array> createQuad(const FloatQuad& quad)
 {
-    Ref<InspectorArray> array = InspectorArray::create();
+    Ref<JSON::Array> array = JSON::Array::create();
     array->pushDouble(quad.p1().x());
     array->pushDouble(quad.p1().y());
     array->pushDouble(quad.p2().x());
@@ -139,14 +139,14 @@
     return array;
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createPaintData(const FloatQuad& quad)
+Ref<JSON::Object> TimelineRecordFactory::createPaintData(const FloatQuad& quad)
 {
-    Ref<InspectorObject> data = InspectorObject::create();
+    Ref<JSON::Object> data = JSON::Object::create();
     data->setArray(ASCIILiteral("clip"), createQuad(quad));
     return data;
 }
 
-void TimelineRecordFactory::appendLayoutRoot(InspectorObject* data, const FloatQuad& quad)
+void TimelineRecordFactory::appendLayoutRoot(JSON::Object* data, const FloatQuad& quad)
 {
     data->setArray(ASCIILiteral("root"), createQuad(quad));
 }
--- a/modules/javafx.web/src/main/native/Source/WebCore/inspector/TimelineRecordFactory.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/inspector/TimelineRecordFactory.h	Fri Jan 05 11:40:42 2018 +0530
@@ -31,8 +31,8 @@
 
 #pragma once
 
-#include <inspector/InspectorValues.h>
 #include <wtf/Forward.h>
+#include <wtf/JSONValues.h>
 #include <wtf/Seconds.h>
 #include <wtf/text/WTFString.h>
 
@@ -47,20 +47,20 @@
 
 class TimelineRecordFactory {
 public:
-    static Ref<Inspector::InspectorObject> createGenericRecord(double startTime, int maxCallStackDepth);
+    static Ref<JSON::Object> createGenericRecord(double startTime, int maxCallStackDepth);
 
-    static Ref<Inspector::InspectorObject> createFunctionCallData(const String& scriptName, int scriptLine);
-    static Ref<Inspector::InspectorObject> createConsoleProfileData(const String& title);
-    static Ref<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId);
-    static Ref<Inspector::InspectorObject> createEventDispatchData(const Event&);
-    static Ref<Inspector::InspectorObject> createGenericTimerData(int timerId);
-    static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, Seconds timeout, bool singleShot);
-    static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
-    static Ref<Inspector::InspectorObject> createTimeStampData(const String&);
-    static Ref<Inspector::InspectorObject> createAnimationFrameData(int callbackId);
-    static Ref<Inspector::InspectorObject> createPaintData(const FloatQuad&);
+    static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine);
+    static Ref<JSON::Object> createConsoleProfileData(const String& title);
+    static Ref<JSON::Object> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId);
+    static Ref<JSON::Object> createEventDispatchData(const Event&);
+    static Ref<JSON::Object> createGenericTimerData(int timerId);
+    static Ref<JSON::Object> createTimerInstallData(int timerId, Seconds timeout, bool singleShot);
+    static Ref<JSON::Object> createEvaluateScriptData(const String&, double lineNumber);
+    static Ref<JSON::Object> createTimeStampData(const String&);
+    static Ref<JSON::Object> createAnimationFrameData(int callbackId);
+    static Ref<JSON::Object> createPaintData(const FloatQuad&);
 
-    static void appendLayoutRoot(Inspector::InspectorObject* data, const FloatQuad&);
+    static void appendLayoutRoot(JSON::Object* data, const FloatQuad&);
 
 private:
     TimelineRecordFactory() { }
--- a/modules/javafx.web/src/main/native/Source/WebCore/loader/FrameLoader.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/loader/FrameLoader.h	Fri Jan 05 11:40:42 2018 +0530
@@ -157,6 +157,9 @@
     DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocumentLoader.get(); }
     FrameState state() const { return m_state; }
 
+    void setShouldReportResourceTimingToParentFrame(bool value) { m_shouldReportResourceTimingToParentFrame = value; }
+    bool shouldReportResourceTimingToParentFrame() { return m_shouldReportResourceTimingToParentFrame; };
+
 #if PLATFORM(IOS)
     RetainPtr<CFDictionaryRef> connectionProperties(ResourceLoader*);
 #endif
@@ -415,6 +418,7 @@
     bool m_quickRedirectComing;
     bool m_sentRedirectNotification;
     bool m_inStopAllLoaders;
+    bool m_shouldReportResourceTimingToParentFrame { true };
 
     String m_outgoingReferrer;
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/loader/ResourceTimingInformation.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/loader/ResourceTimingInformation.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -30,6 +30,7 @@
 #include "DOMWindow.h"
 #include "Document.h"
 #include "Frame.h"
+#include "FrameLoader.h"
 #include "HTMLFrameOwnerElement.h"
 #include "LoadTiming.h"
 #include "Performance.h"
@@ -69,8 +70,10 @@
         return;
 
     Document* initiatorDocument = &document;
-    if (resource.type() == CachedResource::MainResource)
+    if (resource.type() == CachedResource::MainResource && document.frame() && document.frame()->loader().shouldReportResourceTimingToParentFrame()) {
+        document.frame()->loader().setShouldReportResourceTimingToParentFrame(false);
         initiatorDocument = document.parentDocument();
+    }
     if (!initiatorDocument)
         return;
     if (!initiatorDocument->domWindow())
--- a/modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -4976,6 +4976,12 @@
     return p;
 }
 
+FloatRect FrameView::clientToDocumentRect(FloatRect rect) const
+{
+    rect.move(-documentToClientOffset());
+    return rect;
+}
+
 FloatPoint FrameView::clientToDocumentPoint(FloatPoint point) const
 {
     point.move(-documentToClientOffset());
--- a/modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.h	Fri Jan 05 11:40:42 2018 +0530
@@ -477,6 +477,7 @@
     FloatSize documentToClientOffset() const;
     FloatRect documentToClientRect(FloatRect) const;
     FloatPoint documentToClientPoint(FloatPoint) const;
+    WEBCORE_EXPORT FloatRect clientToDocumentRect(FloatRect) const;
     WEBCORE_EXPORT FloatPoint clientToDocumentPoint(FloatPoint) const;
 
     FloatRect layoutViewportToAbsoluteRect(FloatRect) const;
--- a/modules/javafx.web/src/main/native/Source/WebCore/page/csp/ContentSecurityPolicy.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/page/csp/ContentSecurityPolicy.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -53,10 +53,10 @@
 #include "SecurityPolicyViolationEvent.h"
 #include "Settings.h"
 #include "TextEncoding.h"
-#include <inspector/InspectorValues.h>
 #include <inspector/ScriptCallStack.h>
 #include <inspector/ScriptCallStackFactory.h>
 #include <pal/crypto/CryptoDigest.h>
+#include <wtf/JSONValues.h>
 #include <wtf/SetForScope.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/TextPosition.h>
@@ -679,7 +679,7 @@
     // sent explicitly. As for which directive was violated, that's pretty
     // harmless information.
 
-    auto cspReport = InspectorObject::create();
+    auto cspReport = JSON::Object::create();
     cspReport->setString(ASCIILiteral("document-uri"), documentURI);
     cspReport->setString(ASCIILiteral("referrer"), referrer);
     cspReport->setString(ASCIILiteral("violated-directive"), violatedDirectiveText);
@@ -693,7 +693,7 @@
         cspReport->setInteger(ASCIILiteral("column-number"), columnNumber);
     }
 
-    auto reportObject = InspectorObject::create();
+    auto reportObject = JSON::Object::create();
     reportObject->setObject(ASCIILiteral("csp-report"), WTFMove(cspReport));
 
     auto report = FormData::create(reportObject->toJSONString().utf8());
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/GLContext.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/GLContext.h	Fri Jan 05 11:40:42 2018 +0530
@@ -24,10 +24,17 @@
 #include "PlatformDisplay.h"
 #include <wtf/Noncopyable.h>
 
-#if USE(EGL) && !PLATFORM(GTK) && !PLATFORM(WPE)
+#if USE(EGL) && !PLATFORM(GTK)
+#if PLATFORM(WPE)
+// FIXME: For now default to the GBM EGL platform, but this should really be
+// somehow deducible from the build configuration.
+#define __GBM__ 1
+#include <EGL/eglplatform.h>
+#else
 #include "eglplatform.h"
+#endif // PLATFORM(WPE)
 typedef EGLNativeWindowType GLNativeWindowType;
-#else
+#else // !USE(EGL) || PLATFORM(GTK)
 typedef uint64_t GLNativeWindowType;
 #endif
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -2124,7 +2124,8 @@
     m_textAppSinkPad = adoptGRef(gst_element_get_static_pad(m_textAppSink.get(), "sink"));
     ASSERT(m_textAppSinkPad);
 
-    g_object_set(m_textAppSink.get(), "emit-signals", true, "enable-last-sample", false, "caps", gst_caps_new_empty_simple("text/vtt"), nullptr);
+    GRefPtr<GstCaps> textCaps = adoptGRef(gst_caps_new_empty_simple("text/vtt"));
+    g_object_set(m_textAppSink.get(), "emit-signals", TRUE, "enable-last-sample", FALSE, "caps", textCaps.get(), nullptr);
     g_signal_connect_swapped(m_textAppSink.get(), "new-sample", G_CALLBACK(newTextSampleCallback), this);
 
     g_object_set(m_pipeline.get(), "text-sink", m_textAppSink.get(), nullptr);
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -24,9 +24,11 @@
  */
 
 #include "config.h"
+#include "TextCombinerGStreamer.h"
+
 #if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK)
 
-#include "TextCombinerGStreamer.h"
+#include "GRefPtrGStreamer.h"
 
 static GstStaticPadTemplate sinkTemplate =
     GST_STATIC_PAD_TEMPLATE("sink_%u", GST_PAD_SINK, GST_PAD_REQUEST,
@@ -83,17 +85,15 @@
     UNUSED_PARAM(ret);
     ASSERT(ret);
 
-    GstPad* pad = gst_element_get_static_pad(combiner->funnel, "src");
+    GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(combiner->funnel, "src"));
     ASSERT(pad);
 
-    ret = gst_element_add_pad(GST_ELEMENT(combiner), gst_ghost_pad_new("src", pad));
+    ret = gst_element_add_pad(GST_ELEMENT(combiner), gst_ghost_pad_new("src", pad.get()));
     ASSERT(ret);
 }
 
 static void webkit_text_combiner_pad_init(WebKitTextCombinerPad* pad)
 {
-    pad->tags = 0;
-
     gst_pad_set_event_function(GST_PAD(pad), webkitTextCombinerPadEvent);
 }
 
@@ -135,17 +135,17 @@
         gst_event_parse_caps(event, &caps);
         ASSERT(caps);
 
-        GstPad* target = gst_ghost_pad_get_target(GST_GHOST_PAD(pad));
+        GRefPtr<GstPad> target = adoptGRef(gst_ghost_pad_get_target(GST_GHOST_PAD(pad)));
         ASSERT(target);
 
-        GstElement* targetParent = gst_pad_get_parent_element(target);
+        GRefPtr<GstElement> targetParent = adoptGRef(gst_pad_get_parent_element(target.get()));
         ASSERT(targetParent);
 
-        GstCaps* textCaps = gst_caps_new_empty_simple("text/x-raw");
-        if (gst_caps_can_intersect(textCaps, caps)) {
+        GRefPtr<GstCaps> textCaps = adoptGRef(gst_caps_new_empty_simple("text/x-raw"));
+        if (gst_caps_can_intersect(textCaps.get(), caps)) {
             /* Caps are plain text, put a WebVTT encoder between the ghostpad and
              * the funnel */
-            if (targetParent == combiner->funnel) {
+            if (targetParent.get() == combiner->funnel) {
                 /* Setup a WebVTT encoder */
                 GstElement* encoder = gst_element_factory_make("webvttenc", nullptr);
                 ASSERT(encoder);
@@ -157,45 +157,38 @@
                 ASSERT(ret);
 
                 /* Switch the ghostpad to target the WebVTT encoder */
-                GstPad* sinkPad = gst_element_get_static_pad(encoder, "sink");
+                GRefPtr<GstPad> sinkPad = adoptGRef(gst_element_get_static_pad(encoder, "sink"));
                 ASSERT(sinkPad);
 
-                ret = gst_ghost_pad_set_target(GST_GHOST_PAD(pad), sinkPad);
+                ret = gst_ghost_pad_set_target(GST_GHOST_PAD(pad), sinkPad.get());
                 ASSERT(ret);
-                gst_object_unref(sinkPad);
 
                 /* Connect the WebVTT encoder to the funnel */
-                GstPad* srcPad = gst_element_get_static_pad(encoder, "src");
+                GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_static_pad(encoder, "src"));
                 ASSERT(srcPad);
 
-                ret = GST_PAD_LINK_SUCCESSFUL(gst_pad_link(srcPad, target));
+                ret = GST_PAD_LINK_SUCCESSFUL(gst_pad_link(srcPad.get(), target.get()));
                 ASSERT(ret);
-                gst_object_unref(srcPad);
             } /* else: pipeline is already correct */
         } else {
             /* Caps are not plain text, remove the WebVTT encoder */
-            if (targetParent != combiner->funnel) {
+            if (targetParent.get() != combiner->funnel) {
                 /* Get the funnel sink pad */
-                GstPad* srcPad = gst_element_get_static_pad(targetParent, "src");
+                GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_static_pad(targetParent.get(), "src"));
                 ASSERT(srcPad);
 
-                GstPad* sinkPad = gst_pad_get_peer(srcPad);
+                GRefPtr<GstPad> sinkPad = adoptGRef(gst_pad_get_peer(srcPad.get()));
                 ASSERT(sinkPad);
-                gst_object_unref(srcPad);
 
                 /* Switch the ghostpad to target the funnel */
-                ret = gst_ghost_pad_set_target(GST_GHOST_PAD(pad), sinkPad);
+                ret = gst_ghost_pad_set_target(GST_GHOST_PAD(pad), sinkPad.get());
                 ASSERT(ret);
-                gst_object_unref(sinkPad);
 
                 /* Remove the WebVTT encoder */
-                ret = gst_bin_remove(GST_BIN(combiner), targetParent);
+                ret = gst_bin_remove(GST_BIN(combiner), targetParent.get());
                 ASSERT(ret);
             } /* else: pipeline is already correct */
         }
-        gst_caps_unref(textCaps);
-        gst_object_unref(targetParent);
-        gst_object_unref(target);
         break;
     }
     case GST_EVENT_TAG: {
@@ -252,13 +245,12 @@
 static void webkitTextCombinerReleasePad(GstElement *element, GstPad *pad)
 {
     WebKitTextCombiner* combiner = WEBKIT_TEXT_COMBINER(element);
-    GstPad* peer = gst_pad_get_peer(pad);
-    if (peer) {
-        GstElement* parent = gst_pad_get_parent_element(peer);
+    if (GRefPtr<GstPad> peer = adoptGRef(gst_pad_get_peer(pad))) {
+        GRefPtr<GstElement> parent = adoptGRef(gst_pad_get_parent_element(peer.get()));
         ASSERT(parent);
-        gst_element_release_request_pad(parent, peer);
-        if (parent != combiner->funnel)
-            gst_bin_remove(GST_BIN(combiner), parent);
+        gst_element_release_request_pad(parent.get(), peer.get());
+        if (parent.get() != combiner->funnel)
+            gst_bin_remove(GST_BIN(combiner), parent.get());
     }
 
     gst_element_remove_pad(element, pad);
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -532,7 +532,7 @@
 void CoordinatedGraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect, ShouldClipToLayer)
 {
     if (m_mainBackingStore)
-        m_mainBackingStore->invalidate(IntRect(rect));
+        m_mainBackingStore->invalidate(enclosingIntRect(rect));
 
     didChangeLayerState();
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/svg/SVGAnimatedTypeAnimator.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/svg/SVGAnimatedTypeAnimator.h	Fri Jan 05 11:40:42 2018 +0530
@@ -78,8 +78,11 @@
     {
         ASSERT(animatedTypes[0].properties.size() == 1);
         ASSERT(type.type() == m_type);
+        auto* property = castAnimatedPropertyToActualType<AnimValType>(animatedTypes[0].properties[0].get());
+        property->synchronizeWrappersIfNeeded();
+
         typename AnimValType::ContentType& animatedTypeValue = (type.*getter)();
-        animatedTypeValue = castAnimatedPropertyToActualType<AnimValType>(animatedTypes[0].properties[0].get())->currentBaseValue();
+        animatedTypeValue = property->currentBaseValue();
 
         executeAction<AnimValType>(StartAnimationAction, animatedTypes, 0, &animatedTypeValue);
     }
--- a/modules/javafx.web/src/main/native/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h	Fri Jan 05 11:40:42 2018 +0530
@@ -106,6 +106,11 @@
         ASSERT(isAnimating());
     }
 
+    void synchronizeWrappersIfNeeded()
+    {
+        // no-op
+    }
+
 private:
     SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property)
         : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType)
--- a/modules/javafx.web/src/main/native/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h	Fri Jan 05 11:40:42 2018 +0530
@@ -93,6 +93,11 @@
         ASSERT(isAnimating());
     }
 
+    void synchronizeWrappersIfNeeded()
+    {
+        // no-op
+    }
+
 protected:
     SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property)
         : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType)
--- a/modules/javafx.web/src/main/native/Source/WebCore/testing/Internals.cpp	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WebCore/testing/Internals.cpp	Fri Jan 05 11:40:42 2018 +0530
@@ -149,9 +149,9 @@
 #include <bytecode/CodeBlock.h>
 #include <inspector/InspectorAgentBase.h>
 #include <inspector/InspectorFrontendChannel.h>
-#include <inspector/InspectorValues.h>
 #include <runtime/JSCInlines.h>
 #include <runtime/JSCJSValue.h>
+#include <wtf/JSONValues.h>
 #include <wtf/MemoryPressureHandler.h>
 #include <wtf/MonotonicTime.h>
 #include <wtf/text/StringBuffer.h>
--- a/modules/javafx.web/src/main/native/Source/cmake/OptionsGTK.cmake	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/cmake/OptionsGTK.cmake	Fri Jan 05 11:40:42 2018 +0530
@@ -1,11 +1,11 @@
 include(GNUInstallDirs)
 include(VersioningUtils)
 
-SET_PROJECT_VERSION(2 18 3)
+SET_PROJECT_VERSION(2 18 4)
 set(WEBKITGTK_API_VERSION 4.0)
 
-CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 61 6 24)
-CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 24 12 6)
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 61 7 24)
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 24 13 6)
 
 # These are shared variables, but we special case their definition so that we can use the
 # CMAKE_INSTALL_* variables that are populated by the GNUInstallDirs macro.
--- a/modules/javafx.web/src/main/native/Source/cmake/OptionsWPE.cmake	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/cmake/OptionsWPE.cmake	Fri Jan 05 11:40:42 2018 +0530
@@ -16,6 +16,8 @@
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ENCRYPTED_MEDIA PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GAMEPAD PUBLIC OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC OFF)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBDRIVER PUBLIC ON)
+
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_INDEXED_DATABASE_IN_WORKERS PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CONTROLS_SCRIPT PUBLIC ON)
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/waylanddriver.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/waylanddriver.py	Fri Jan 05 11:40:42 2018 +0530
@@ -50,13 +50,14 @@
         self._port._copy_value_from_environ_if_set(driver_environment, 'WAYLAND_SOCKET')
         driver_environment['GDK_BACKEND'] = 'wayland'
         driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
+        if self._driver_tempdir is not None:
         driver_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
         driver_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
         return driver_environment
 
     def _start(self, pixel_tests, per_test_args):
         super(WaylandDriver, self).stop()
-        self._driver_tempdir = self._port.host.filesystem.mkdtemp(prefix='%s-' % self._server_name)
+        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
         self._crashed_process_name = None
         self._crashed_pid = None
         self._server_process = self._port._server_process_constructor(self._port, self._server_name, self.cmd_line(pixel_tests, per_test_args), self._setup_environ_for_test())
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/westondriver.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/westondriver.py	Fri Jan 05 11:40:42 2018 +0530
@@ -55,7 +55,6 @@
         self._xvfbdriver = XvfbDriver(*args, **kwargs)
 
     def _setup_environ_for_test(self):
-        self._driver_directory = self._port.host.filesystem.mkdtemp(prefix='%s-' % self._server_name)
         driver_environment = self._port.setup_environ_for_server(self._server_name)
         driver_environment['DISPLAY'] = ":%d" % self._xvfbdriver._xvfb_run(driver_environment)
         weston_socket = 'WKTesting-weston-%032x' % random.getrandbits(128)
@@ -69,10 +68,11 @@
         time.sleep(self._startup_delay_secs)
 
         driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
+        if self._driver_tempdir is not None:
         # Currently on WebKit2, there is no API for setting the application cache directory.
         # Each worker should have its own and it should be cleaned afterwards, when the worker stops.
-        driver_environment['XDG_CACHE_HOME'] = self._ensure_driver_tmpdir_subdirectory('appcache')
-        driver_environment['DUMPRENDERTREE_TEMP'] = self._ensure_driver_tmpdir_subdirectory('drt-temp')
+            driver_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
+            driver_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
         driver_environment['WAYLAND_DISPLAY'] = weston_socket
         driver_environment['GDK_BACKEND'] = 'wayland'
         if driver_environment.get('DISPLAY'):
@@ -81,6 +81,7 @@
 
     def _start(self, pixel_tests, per_test_args):
         self.stop()
+        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
         self._crashed_process_name = None
         self._crashed_pid = None
         self._server_process = self._port._server_process_constructor(self._port, self._server_name, self.cmd_line(pixel_tests, per_test_args), self._setup_environ_for_test())
@@ -92,11 +93,4 @@
             # The Weston process is terminated instead of killed, giving the Weston a chance to clean up after itself.
             self._weston_process.terminate()
             self._weston_process = None
-        if getattr(self, '_driver_directory', None):
-            self._port.host.filesystem.rmtree(str(self._driver_directory))
 
-    def _ensure_driver_tmpdir_subdirectory(self, subdirectory):
-        assert getattr(self, '_driver_directory', None)
-        directory_path = self._port.host.filesystem.join(str(self._driver_directory), subdirectory)
-        self._port.host.filesystem.maybe_make_directory(directory_path)
-        return directory_path
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/westondriver_unittest.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/westondriver_unittest.py	Fri Jan 05 11:40:42 2018 +0530
@@ -50,8 +50,8 @@
 
 
 class WestonDriverTest(unittest.TestCase):
-    def make_driver(self, filesystem=None):
-        port = Port(MockSystemHost(log_executive=True, filesystem=filesystem), 'westondrivertestport', options=MockOptions(configuration='Release'))
+    def make_driver(self):
+        port = Port(MockSystemHost(log_executive=True), 'westondrivertestport', options=MockOptions(configuration='Release'))
         port._config.build_directory = lambda configuration: "/mock_build"
         port._server_process_constructor = MockServerProcess
 
@@ -85,13 +85,10 @@
             def terminate(self):
                 _log.info("MOCK FakeWestonProcess.terminate")
 
-        filesystem = MockFileSystem(dirs=['/tmp/weston-driver-directory'])
-        driver = self.make_driver(filesystem)
+        driver = self.make_driver()
         driver._weston_process = FakeWestonProcess()
-        driver._driver_directory = '/tmp/weston-driver-directory'
 
         expected_logs = "MOCK FakeWestonProcess.terminate\n"
         OutputCapture().assert_outputs(self, driver.stop, [], expected_logs=expected_logs)
 
         self.assertIsNone(driver._weston_process)
-        self.assertFalse(driver._port._filesystem.exists(driver._driver_directory))
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/wpe.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/wpe.py	Fri Jan 05 11:40:42 2018 +0530
@@ -30,6 +30,7 @@
 from webkitpy.layout_tests.models.test_configuration import TestConfiguration
 from webkitpy.port.base import Port
 from webkitpy.port.linux_get_crash_log import GDBCrashLogGenerator
+from webkitpy.port.waylanddriver import WaylandDriver
 
 
 class WPEPort(Port):
@@ -38,6 +39,7 @@
     def __init__(self, *args, **kwargs):
         super(WPEPort, self).__init__(*args, **kwargs)
 
+        self._display_server = self.get_option("display_server")
         if self._should_use_jhbuild():
             self._jhbuild_wrapper = [self.path_from_webkit_base('Tools', 'jhbuild', 'jhbuild-wrapper'), '--wpe', 'run']
             self.set_option_default('wrapper', ' '.join(self._jhbuild_wrapper))
@@ -61,6 +63,12 @@
     def _port_flag_for_scripts(self):
         return "--wpe"
 
+    @memoized
+    def _driver_class(self):
+        if self._display_server == "wayland":
+            return WaylandDriver
+        return super(WPEPort, self)._driver_class()
+
     def setup_environ_for_server(self, server_name=None):
         environment = super(WPEPort, self).setup_environ_for_server(server_name)
         environment['GSETTINGS_BACKEND'] = 'memory'
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/xorgdriver.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/xorgdriver.py	Fri Jan 05 11:40:42 2018 +0530
@@ -50,6 +50,7 @@
         self._port._copy_value_from_environ_if_set(server_environment, 'XAUTHORITY')
         server_environment['GDK_BACKEND'] = 'x11'
         server_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
+        if self._driver_tempdir is not None:
         server_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
         # Currently on WebKit2, there is no API for setting the application
         # cache directory. Each worker should have it's own and it should be
@@ -61,7 +62,7 @@
     def _start(self, pixel_tests, per_test_args):
         super(XorgDriver, self).stop()
 
-        self._driver_tempdir = self._port.host.filesystem.mkdtemp(prefix='%s-' % self._server_name)
+        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
 
         self._crashed_process_name = None
         self._crashed_pid = None
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/xvfbdriver.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/port/xvfbdriver.py	Fri Jan 05 11:40:42 2018 +0530
@@ -99,10 +99,9 @@
         # We must do this here because the DISPLAY number depends on _worker_number
         environment['DISPLAY'] = ":%d" % display_id
         environment['GDK_BACKEND'] = 'x11'
-        self._driver_tempdir = self._port.host.filesystem.mkdtemp(prefix='%s-' % self._server_name)
-        environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
         environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-
+        if self._driver_tempdir is not None:
+            environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
         # Currently on WebKit2, there is no API for setting the application
         # cache directory. Each worker should have it's own and it should be
         # cleaned afterwards, so we set it to inside the temporary folder by
@@ -112,6 +111,7 @@
 
     def _start(self, pixel_tests, per_test_args):
         self.stop()
+        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
         self._crashed_process_name = None
         self._crashed_pid = None
         self._server_process = self._port._server_process_constructor(self._port, self._server_name, self.cmd_line(pixel_tests, per_test_args), self._setup_environ_for_test())
--- a/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/style/checker.py	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/style/checker.py	Fri Jan 05 11:40:42 2018 +0530
@@ -337,6 +337,8 @@
 _SKIPPED_FILES_WITHOUT_WARNING = [
     "LayoutTests" + os.path.sep,
 
+    "WebDriverTests" + os.path.sep,
+
     # Files generated by the bindings script should not be checked for style.
     os.path.join('Source', 'WebCore', 'bindings', 'scripts', 'test'),
 
--- a/modules/javafx.web/src/main/native/Tools/wpe/jhbuild.modules	Fri Dec 22 12:50:57 2017 +0530
+++ b/modules/javafx.web/src/main/native/Tools/wpe/jhbuild.modules	Fri Jan 05 11:40:42 2018 +0530
@@ -275,7 +275,7 @@
   </autotools>
 
   <autotools id="dyz" supports-non-srcdir-builds="no">
-    <branch repo="github.com" module="Igalia/dyz" tag="0880252bac243add39ea54c0797ceb167d775ce9"/>
+    <branch repo="github.com" module="Igalia/dyz" tag="203a1ebd1481e44aa8105e862c02f317e6653627"/>
   </autotools>
 
 </moduleset>