Title: [253093] trunk
Revision
253093
Author
megan_gard...@apple.com
Date
2019-12-03 21:48:46 -0800 (Tue, 03 Dec 2019)

Log Message

Add disabled highlight API skeleton
https://bugs.webkit.org/show_bug.cgi?id=204809

Reviewed by Ryosuke Niwa.

Source/WebCore:

Beginning implementation of https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/highlight/explainer.md
Spec not written yet, starting from the explainer for now.

Test: highlight/highlight-interfaces.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/highlight/HighlightMap.cpp: Added.
(WebCore::HighlightMap::addHighlightGroup):
(WebCore::HighlightMap::addFromMapLike):
(WebCore::HighlightMap::remove):
(WebCore::HighlightMap::namedItem const):
(WebCore::HighlightMap::setNamedItem):
(WebCore::HighlightMap::deleteNamedProperty):
(WebCore::HighlightMap::set):
* Modules/highlight/HighlightMap.h: Added.
(WebCore::HighlightMap::create):
(WebCore::HighlightMap::synchronizeBackingMap):
(WebCore::HighlightMap::backingMap):
(WebCore::HighlightMap::clear):
* Modules/highlight/HighlightMap.idl: Added.
* Modules/highlight/HighlightRangeGroup.cpp: Added.
(WebCore::HighlightRangeGroup::HighlightRangeGroup):
(WebCore::HighlightRangeGroup::create):
(WebCore::HighlightRangeGroup::addRange):
(WebCore::HighlightRangeGroup::removeRange):
(WebCore::HighlightRangeGroup::Iterator::Iterator):
(WebCore::HighlightRangeGroup::Iterator::next):
* Modules/highlight/HighlightRangeGroup.h: Added.
(WebCore::HighlightRangeGroup::createIterator):
* Modules/highlight/HighlightRangeGroup.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::highlights):
* css/DOMCSSNamespace.h:
* css/DOMCSSNamespace.idl:
* dom/Document.cpp:
(WebCore::Document::highlightMap):
* dom/Document.h:
* dom/Range.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setHighlightAPIEnabled):
(WebCore::RuntimeEnabledFeatures::highlightAPIEnabled const):

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetHighlightAPIEnabled):
(WKPreferencesGetHighlightAPIEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

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

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* highlight/highlight-interfaces-expected.txt: Added.
* highlight/highlight-interfaces.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (253092 => 253093)


--- trunk/LayoutTests/ChangeLog	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/LayoutTests/ChangeLog	2019-12-04 05:48:46 UTC (rev 253093)
@@ -1,3 +1,13 @@
+2019-12-03  Megan Gardner  <megan_gard...@apple.com>
+
+        Add disabled highlight API skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=204809
+
+        Reviewed by Ryosuke Niwa.
+
+        * highlight/highlight-interfaces-expected.txt: Added.
+        * highlight/highlight-interfaces.html: Added.
+
 2019-11-23  Ryosuke Niwa  <rn...@webkit.org>
 
         Perform microtask checkpoint after each task as spec'ed

Added: trunk/LayoutTests/highlight/highlight-interfaces-expected.txt (0 => 253093)


--- trunk/LayoutTests/highlight/highlight-interfaces-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/highlight/highlight-interfaces-expected.txt	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,19 @@
+Tests the interfaces of the highlight API, which include HighlightRangeGroup, HighlightMap, and extensions to the CSS namespace.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing Highlight:
+PASS HighlightRangeGroup instanceof Function is true
+PASS typeof HighlightRangeGroup is "function"
+PASS new HighlightRangeGroup(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})) instanceof HighlightRangeGroup is true
+PASS HighlightMap instanceof Function is true
+PASS typeof HighlightMap is "function"
+PASS new HighlightMap() instanceof HighlightMap is true
+PASS new HighlightMap().set("foo-styling",new HighlightRangeGroup(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2}))) is undefined.
+PASS CSS.highlights is defined.
+PASS CSS.highlights.set("foo-styling",new HighlightRangeGroup(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2}))) is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/highlight/highlight-interfaces.html (0 => 253093)


--- trunk/LayoutTests/highlight/highlight-interfaces.html	                        (rev 0)
+++ trunk/LayoutTests/highlight/highlight-interfaces.html	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,22 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:HighlightAPIEnabled=true ] -->
+<html>
+<body>
+<script src=""
+<script>
+
+description("Tests the interfaces of the highlight API, which include HighlightRangeGroup, HighlightMap, and extensions to the CSS namespace.");
+
+debug("Testing Highlight:");
+shouldBeTrue("HighlightRangeGroup instanceof Function");
+shouldBeEqualToString("typeof HighlightRangeGroup", "function");
+shouldBeTrue("new HighlightRangeGroup(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})) instanceof HighlightRangeGroup");
+shouldBeTrue("HighlightMap instanceof Function");
+shouldBeEqualToString("typeof HighlightMap", "function");
+shouldBeTrue("new HighlightMap() instanceof HighlightMap");
+shouldBeUndefined('new HighlightMap().set("foo-styling",new HighlightRangeGroup(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})))');
+shouldBeDefined('CSS.highlights');
+shouldBeUndefined('CSS.highlights.set("foo-styling",new HighlightRangeGroup(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})))');
+
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/win/TestExpectations (253092 => 253093)


--- trunk/LayoutTests/platform/win/TestExpectations	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/LayoutTests/platform/win/TestExpectations	2019-12-04 05:48:46 UTC (rev 253093)
@@ -403,6 +403,9 @@
 # viewport meta tag support
 fast/viewport/ [ Skip ]
 
+# highlight API
+highlight/ [ Skip ]
+
 # Pre-HMTL5 parser quirks only apply to the mac port for now.
 fast/parser/pre-html5-parser-quirks.html [ Skip ]
 

Modified: trunk/Source/WebCore/CMakeLists.txt (253092 => 253093)


--- trunk/Source/WebCore/CMakeLists.txt	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/CMakeLists.txt	2019-12-04 05:48:46 UTC (rev 253093)
@@ -37,6 +37,7 @@
     "${WEBCORE_DIR}/Modules/entriesapi"
     "${WEBCORE_DIR}/Modules/fetch"
     "${WEBCORE_DIR}/Modules/geolocation"
+    "${WEBCORE_DIR}/Modules/highlight"
     "${WEBCORE_DIR}/Modules/indexeddb"
     "${WEBCORE_DIR}/Modules/indexeddb/client"
     "${WEBCORE_DIR}/Modules/indexeddb/server"
@@ -195,6 +196,7 @@
     Modules/entriesapi
     Modules/fetch
     Modules/geolocation
+    Modules/highlight
     Modules/indexeddb
     Modules/mediacapabilities
     Modules/mediarecorder
@@ -276,6 +278,9 @@
     Modules/geolocation/PositionErrorCallback.idl
     Modules/geolocation/PositionOptions.idl
 
+    Modules/highlight/HighlightMap.idl
+    Modules/highlight/HighlightRangeGroup.idl
+
     Modules/indexeddb/DOMWindowIndexedDatabase.idl
     Modules/indexeddb/IDBCursor.idl
     Modules/indexeddb/IDBCursorDirection.idl

Modified: trunk/Source/WebCore/ChangeLog (253092 => 253093)


--- trunk/Source/WebCore/ChangeLog	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/ChangeLog	2019-12-04 05:48:46 UTC (rev 253093)
@@ -1,3 +1,58 @@
+2019-12-03  Megan Gardner  <megan_gard...@apple.com>
+
+        Add disabled highlight API skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=204809
+
+        Reviewed by Ryosuke Niwa.
+
+        Beginning implementation of https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/highlight/explainer.md
+        Spec not written yet, starting from the explainer for now.
+
+        Test: highlight/highlight-interfaces.html
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/highlight/HighlightMap.cpp: Added.
+        (WebCore::HighlightMap::addHighlightGroup):
+        (WebCore::HighlightMap::addFromMapLike):
+        (WebCore::HighlightMap::remove):
+        (WebCore::HighlightMap::namedItem const):
+        (WebCore::HighlightMap::setNamedItem):
+        (WebCore::HighlightMap::deleteNamedProperty):
+        (WebCore::HighlightMap::set):
+        * Modules/highlight/HighlightMap.h: Added.
+        (WebCore::HighlightMap::create):
+        (WebCore::HighlightMap::synchronizeBackingMap):
+        (WebCore::HighlightMap::backingMap):
+        (WebCore::HighlightMap::clear):
+        * Modules/highlight/HighlightMap.idl: Added.
+        * Modules/highlight/HighlightRangeGroup.cpp: Added.
+        (WebCore::HighlightRangeGroup::HighlightRangeGroup):
+        (WebCore::HighlightRangeGroup::create):
+        (WebCore::HighlightRangeGroup::addRange):
+        (WebCore::HighlightRangeGroup::removeRange):
+        (WebCore::HighlightRangeGroup::Iterator::Iterator):
+        (WebCore::HighlightRangeGroup::Iterator::next):
+        * Modules/highlight/HighlightRangeGroup.h: Added.
+        (WebCore::HighlightRangeGroup::createIterator):
+        * Modules/highlight/HighlightRangeGroup.idl: Added.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * css/DOMCSSNamespace.cpp:
+        (WebCore::DOMCSSNamespace::highlights):
+        * css/DOMCSSNamespace.h:
+        * css/DOMCSSNamespace.idl:
+        * dom/Document.cpp:
+        (WebCore::Document::highlightMap):
+        * dom/Document.h:
+        * dom/Range.idl:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setHighlightAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::highlightAPIEnabled const):
+
 2019-11-22  Ryosuke Niwa  <rn...@webkit.org>
 
         Perform microtask checkpoint after each task as spec'ed

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (253092 => 253093)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2019-12-04 05:48:46 UTC (rev 253093)
@@ -113,6 +113,8 @@
 $(PROJECT_DIR)/Modules/geolocation/PositionError.idl
 $(PROJECT_DIR)/Modules/geolocation/PositionErrorCallback.idl
 $(PROJECT_DIR)/Modules/geolocation/PositionOptions.idl
+$(PROJECT_DIR)/Modules/highlight/HighlightMap.idl
+$(PROJECT_DIR)/Modules/highlight/HighlightRangeGroup.idl
 $(PROJECT_DIR)/Modules/indexeddb/DOMWindowIndexedDatabase.idl
 $(PROJECT_DIR)/Modules/indexeddb/IDBCursor.idl
 $(PROJECT_DIR)/Modules/indexeddb/IDBCursorDirection.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (253092 => 253093)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2019-12-04 05:48:46 UTC (rev 253093)
@@ -691,6 +691,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalEventHandlers.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalPerformance.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSGlobalPerformance.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHighlightMap.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHighlightMap.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHighlightRangeGroup.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHighlightRangeGroup.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLAllCollection.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLAllCollection.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSHTMLAnchorElement.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (253092 => 253093)


--- trunk/Source/WebCore/DerivedSources.make	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/DerivedSources.make	2019-12-04 05:48:46 UTC (rev 253093)
@@ -41,6 +41,7 @@
     $(WebCore)/Modules/fetch \
     $(WebCore)/Modules/gamepad \
     $(WebCore)/Modules/geolocation \
+    $(WebCore)/Modules/highlight \
     $(WebCore)/Modules/indexeddb \
     $(WebCore)/Modules/indieui \
     $(WebCore)/Modules/mediacapabilities \
@@ -188,6 +189,8 @@
     $(WebCore)/Modules/geolocation/PositionCallback.idl \
     $(WebCore)/Modules/geolocation/PositionErrorCallback.idl \
     $(WebCore)/Modules/geolocation/PositionOptions.idl \
+    $(WebCore)/Modules/highlight/HighlightMap.idl \
+    $(WebCore)/Modules/highlight/HighlightRangeGroup.idl \
     $(WebCore)/Modules/indexeddb/DOMWindowIndexedDatabase.idl \
     $(WebCore)/Modules/indexeddb/IDBCursor.idl \
     $(WebCore)/Modules/indexeddb/IDBCursorDirection.idl \

Added: trunk/Source/WebCore/Modules/highlight/HighlightMap.cpp (0 => 253093)


--- trunk/Source/WebCore/Modules/highlight/HighlightMap.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/highlight/HighlightMap.cpp	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2019 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "HighlightMap.h"
+
+namespace WebCore {
+
+void HighlightMap::addHighlightGroup(String& cssStyle, HighlightRangeGroup &group)
+{
+    UNUSED_PARAM(cssStyle);
+    UNUSED_PARAM(group);
+}
+
+bool HighlightMap::addFromMapLike(const String& value)
+{
+    UNUSED_PARAM(value);
+    return false;
+}
+
+bool HighlightMap::remove(const String& value)
+{
+    UNUSED_PARAM(value);
+    return false;
+}
+
+String HighlightMap::namedItem(const AtomString& name) const
+{
+    UNUSED_PARAM(name);
+    
+    return String { };
+}
+
+ExceptionOr<void> HighlightMap::setNamedItem(const String& name, const HighlightRangeGroup& value)
+{
+    UNUSED_PARAM(name);
+    UNUSED_PARAM(value);
+    
+    return { };
+}
+
+bool HighlightMap::deleteNamedProperty(const String& name)
+{
+    UNUSED_PARAM(name);
+    return false;
+}
+
+ExceptionOr<void> HighlightMap::set(const String& name, const HighlightRangeGroup& value)
+{
+    UNUSED_PARAM(name);
+    UNUSED_PARAM(value);
+    
+    return { };
+}
+
+}

Added: trunk/Source/WebCore/Modules/highlight/HighlightMap.h (0 => 253093)


--- trunk/Source/WebCore/Modules/highlight/HighlightMap.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/highlight/HighlightMap.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2019 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "HighlightRangeGroup.h"
+#include "JSDOMMapLike.h"
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class DOMString;
+class HighlightRangeGroup;
+
+class HighlightMap : public RefCounted<HighlightMap> {
+public:
+    static Ref<HighlightMap> create() { return adoptRef(*new HighlightMap); }
+    
+    void addHighlightGroup(String&, HighlightRangeGroup&);
+    
+    void synchronizeBackingMap(Ref<DOMMapLike>&& mapLike) { m_mapLike = WTFMove(mapLike); }
+    DOMMapLike* backingMap() { return m_mapLike.get(); }
+
+    // Bindings support.
+    String namedItem(const AtomString& name) const;
+    ExceptionOr<void> setNamedItem(const String& name, const HighlightRangeGroup& value);
+    bool deleteNamedProperty(const String& name);
+    
+    ExceptionOr<void> set(const String& name, const HighlightRangeGroup& value);
+    
+    bool addFromMapLike(const String& value);
+    void clear() { };
+    bool remove(const String& value);
+    
+private:
+    HighlightMap() = default;
+    HashMap<String, RefPtr<HighlightRangeGroup>> m_map;
+    RefPtr<DOMMapLike> m_mapLike;
+};
+
+}
+

Added: trunk/Source/WebCore/Modules/highlight/HighlightMap.idl (0 => 253093)


--- trunk/Source/WebCore/Modules/highlight/HighlightMap.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/highlight/HighlightMap.idl	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    Constructor(),
+    EnabledAtRuntime=HighlightAPI,
+    ImplementationLacksVTable
+] interface HighlightMap {
+    maplike<DOMString, HighlightRangeGroup>;
+    [CEReactions, MayThrowException] setter void (DOMString style, HighlightRangeGroup group);
+    [MayThrowException] void set(DOMString style, HighlightRangeGroup group);
+};

Added: trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.cpp (0 => 253093)


--- trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.cpp	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2019 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "HighlightRangeGroup.h"
+
+#include "PropertySetCSSStyleDeclaration.h"
+#include "StaticRange.h"
+#include "StyleProperties.h"
+
+namespace WebCore {
+
+HighlightRangeGroup::HighlightRangeGroup(StaticRange& range)
+{
+    addRange(range);
+}
+
+Ref<HighlightRangeGroup> HighlightRangeGroup::create(StaticRange& range)
+{
+    return adoptRef(*new HighlightRangeGroup(range));
+}
+
+ExceptionOr<void> HighlightRangeGroup::addRange(StaticRange& range)
+{
+    UNUSED_PARAM(range);
+
+    return { };
+}
+
+ExceptionOr<void> HighlightRangeGroup::removeRange(StaticRange& range)
+{
+    UNUSED_PARAM(range);
+    
+    return { };
+}
+
+HighlightRangeGroup::Iterator::Iterator(HighlightRangeGroup& group)
+    : m_group(group)
+{
+}
+
+RefPtr<StaticRange> HighlightRangeGroup::Iterator::next()
+{
+    if (m_index == m_group->ranges.size())
+        return nullptr;
+    return m_group->ranges[m_index++].ptr();
+}
+
+}
+

Added: trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.h (0 => 253093)


--- trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2019 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 "ExceptionOr.h"
+#include "StaticRange.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class CSSStyleDeclaration;
+class StaticRange;
+class PropertySetCSSStyleDeclaration;
+
+class HighlightRangeGroup : public RefCounted<HighlightRangeGroup> {
+public:
+    static Ref<HighlightRangeGroup> create(StaticRange&);
+
+    ExceptionOr<void> addRange(StaticRange&);
+    ExceptionOr<void> removeRange(StaticRange&);
+    
+    Vector<Ref<StaticRange>> ranges;
+
+    WEBCORE_EXPORT CSSStyleDeclaration& style();
+    
+    class Iterator {
+    public:
+        explicit Iterator(HighlightRangeGroup&);
+        RefPtr<StaticRange> next();
+        
+    private:
+        Ref<HighlightRangeGroup> m_group;
+        size_t m_index { 0 }; // FIXME: There needs to be a mechanism to handle when ranges are added or removed from the middle of the HighlightRangeGroup.
+    };
+    Iterator createIterator() { return Iterator(*this); }
+    
+private:
+    HighlightRangeGroup(StaticRange&);
+};
+
+}
+

Added: trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.idl (0 => 253093)


--- trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/highlight/HighlightRangeGroup.idl	2019-12-04 05:48:46 UTC (rev 253093)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2019 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+ */
+
+[
+    Constructor(StaticRange range),
+    EnabledAtRuntime=HighlightAPI,
+    ImplementationLacksVTable
+] interface HighlightRangeGroup {
+    iterable<StaticRange>;  // FIXME: should be setlike
+    // FIXME: Add readonly attribute CSSStyleDeclaration style;
+};

Modified: trunk/Source/WebCore/Sources.txt (253092 => 253093)


--- trunk/Source/WebCore/Sources.txt	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/Sources.txt	2019-12-04 05:48:46 UTC (rev 253093)
@@ -79,6 +79,9 @@
 Modules/geolocation/GeolocationCoordinates.cpp
 Modules/geolocation/NavigatorGeolocation.cpp
 
+Modules/highlight/HighlightMap.cpp
+Modules/highlight/HighlightRangeGroup.cpp
+
 Modules/indexeddb/DOMWindowIndexedDatabase.cpp
 Modules/indexeddb/IDBCursor.cpp
 Modules/indexeddb/IDBCursorWithValue.cpp
@@ -2900,6 +2903,8 @@
 JSGlobalCrypto.cpp
 JSGlobalEventHandlers.cpp
 JSGlobalPerformance.cpp
+JSHighlightMap.cpp
+JSHighlightRangeGroup.cpp
 JSHTMLAllCollection.cpp
 JSHTMLAnchorElement.cpp
 JSHTMLAppletElement.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (253092 => 253093)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2019-12-04 05:48:46 UTC (rev 253093)
@@ -7654,6 +7654,12 @@
 		44D8DA9A139545CD00337B75 /* SVGAnimateMotionElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGAnimateMotionElement.idl; sourceTree = "<group>"; };
 		44DAB5AF15A623580097C1E4 /* Extensions3DOpenGLCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Extensions3DOpenGLCommon.cpp; sourceTree = "<group>"; };
 		44DAB5B015A623580097C1E4 /* Extensions3DOpenGLCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Extensions3DOpenGLCommon.h; sourceTree = "<group>"; };
+		44E88E4C2369128A009B4847 /* HighlightMap.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HighlightMap.idl; sourceTree = "<group>"; };
+		44E88E4D2369128B009B4847 /* HighlightRangeGroup.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HighlightRangeGroup.idl; sourceTree = "<group>"; };
+		44E88E50236A56AC009B4847 /* HighlightMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HighlightMap.h; sourceTree = "<group>"; };
+		44E88E51236A5C8D009B4847 /* HighlightRangeGroup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HighlightRangeGroup.h; sourceTree = "<group>"; };
+		44E88E52236A667F009B4847 /* HighlightMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HighlightMap.cpp; sourceTree = "<group>"; };
+		44E88E54236A66A1009B4847 /* HighlightRangeGroup.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HighlightRangeGroup.cpp; sourceTree = "<group>"; };
 		450CEBEE15073BBE002BB149 /* LabelableElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LabelableElement.cpp; sourceTree = "<group>"; };
 		450CEBEF15073BBE002BB149 /* LabelableElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelableElement.h; sourceTree = "<group>"; };
 		4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpinButtonElement.cpp; sourceTree = "<group>"; };
@@ -18381,6 +18387,19 @@
 			path = ios;
 			sourceTree = "<group>";
 		};
+		44E88E472368DF0F009B4847 /* highlight */ = {
+			isa = PBXGroup;
+			children = (
+				44E88E52236A667F009B4847 /* HighlightMap.cpp */,
+				44E88E50236A56AC009B4847 /* HighlightMap.h */,
+				44E88E4C2369128A009B4847 /* HighlightMap.idl */,
+				44E88E54236A66A1009B4847 /* HighlightRangeGroup.cpp */,
+				44E88E51236A5C8D009B4847 /* HighlightRangeGroup.h */,
+				44E88E4D2369128B009B4847 /* HighlightRangeGroup.idl */,
+			);
+			path = highlight;
+			sourceTree = "<group>";
+		};
 		4642404420EAF0BD00B29FD2 /* cocoa */ = {
 			isa = PBXGroup;
 			children = (
@@ -22199,6 +22218,7 @@
 				41F54F7C1C50C4F600338488 /* fetch */,
 				518F4FE9194CA4B60081BAAE /* gamepad */,
 				971145FF14EF007900674FD9 /* geolocation */,
+				44E88E472368DF0F009B4847 /* highlight */,
 				9712A55315004E3C0048AF10 /* indexeddb */,
 				CDBD3D271FE85C920012C545 /* mediacapabilities */,
 				CD9A37F517C7D93600C5FA7A /* mediacontrols */,

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (253092 => 253093)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -112,6 +112,8 @@
     macro(GPUTextureView) \
     macro(GPUUncapturedErrorEvent) \
     macro(GPUValidationError) \
+    macro(HighlightMap) \
+    macro(HighlightRangeGroup) \
     macro(HTMLAttachmentElement) \
     macro(HTMLAudioElement) \
     macro(HTMLDialogElement) \

Modified: trunk/Source/WebCore/css/DOMCSSNamespace.cpp (253092 => 253093)


--- trunk/Source/WebCore/css/DOMCSSNamespace.cpp	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/css/DOMCSSNamespace.cpp	2019-12-04 05:48:46 UTC (rev 253093)
@@ -33,6 +33,7 @@
 #include "CSSMarkup.h"
 #include "CSSParser.h"
 #include "CSSPropertyParser.h"
+#include "HighlightMap.h"
 #include "StyleProperties.h"
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
@@ -87,4 +88,9 @@
     return builder.toString();
 }
 
+HighlightMap& DOMCSSNamespace::highlights(Document& document)
+{
+    return document.highlightMap();
 }
+
+}

Modified: trunk/Source/WebCore/css/DOMCSSNamespace.h (253092 => 253093)


--- trunk/Source/WebCore/css/DOMCSSNamespace.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/css/DOMCSSNamespace.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -37,6 +37,8 @@
 namespace WebCore {
 
 class Document;
+class HighlightMap;
+class HighlightRangeGroup;
 
 class DOMCSSNamespace final : public RefCounted<DOMCSSNamespace>, public Supplementable<DOMCSSNamespace> {
 public:
@@ -43,6 +45,7 @@
     static bool supports(Document&, const String& property, const String& value);
     static bool supports(Document&, const String& conditionText);
     static String escape(const String& ident);
+    static HighlightMap& highlights(Document&);
 };
 
 }

Modified: trunk/Source/WebCore/css/DOMCSSNamespace.idl (253092 => 253093)


--- trunk/Source/WebCore/css/DOMCSSNamespace.idl	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/css/DOMCSSNamespace.idl	2019-12-04 05:48:46 UTC (rev 253093)
@@ -34,4 +34,5 @@
     [CallWith=Document] static boolean supports(DOMString property, DOMString value);
     [CallWith=Document] static boolean supports(DOMString conditionText);
     static DOMString escape(DOMString ident);
+    [EnabledAtRuntime=HighlightAPI, CallWith=Document] static readonly attribute HighlightMap highlights;
 };

Modified: trunk/Source/WebCore/dom/Document.cpp (253092 => 253093)


--- trunk/Source/WebCore/dom/Document.cpp	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/dom/Document.cpp	2019-12-04 05:48:46 UTC (rev 253093)
@@ -108,6 +108,7 @@
 #include "HTTPHeaderNames.h"
 #include "HTTPParsers.h"
 #include "HashChangeEvent.h"
+#include "HighlightMap.h"
 #include "History.h"
 #include "HitTestResult.h"
 #include "IdleCallbackController.h"
@@ -2718,6 +2719,13 @@
     return XMLDocumentParser::create(*this, view());
 }
 
+HighlightMap& Document::highlightMap()
+{
+    if (!m_highlightMap)
+        m_highlightMap = HighlightMap::create();
+    return *m_highlightMap;
+}
+
 ScriptableDocumentParser* Document::scriptableDocumentParser() const
 {
     return parser() ? parser()->asScriptableDocumentParser() : nullptr;

Modified: trunk/Source/WebCore/dom/Document.h (253092 => 253093)


--- trunk/Source/WebCore/dom/Document.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/dom/Document.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -145,6 +145,7 @@
 class HTMLMediaElement;
 class HTMLVideoElement;
 class HTMLScriptElement;
+class HighlightMap;
 class HitTestLocation;
 class HitTestRequest;
 class HitTestResult;
@@ -1565,6 +1566,8 @@
 
     WEBCORE_EXPORT TextManipulationController& textManipulationController();
     TextManipulationController* textManipulationControllerIfExists() { return m_textManipulationController.get(); }
+        
+    HighlightMap& highlightMap();
 
 protected:
     enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
@@ -1887,6 +1890,8 @@
 #if ENABLE(TEXT_AUTOSIZING)
     std::unique_ptr<TextAutoSizing> m_textAutoSizing;
 #endif
+        
+    RefPtr<HighlightMap> m_highlightMap;
 
     Timer m_visualUpdatesSuppressionTimer;
 

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (253092 => 253093)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -214,6 +214,9 @@
 
     void setKeygenElementEnabled(bool isEnabled) { m_keygenElementEnabled = isEnabled; }
     bool keygenElementEnabled() const { return m_keygenElementEnabled; }
+    
+    void setHighlightAPIEnabled(bool isEnabled) { m_highlightAPIEnabled = isEnabled; }
+    bool highlightAPIEnabled() const { return m_highlightAPIEnabled; }
 
 #if ENABLE(ATTACHMENT_ELEMENT)
     void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; }
@@ -447,6 +450,7 @@
     bool m_webSQLEnabled { true };
     bool m_keygenElementEnabled { false };
     bool m_pageAtRuleSupportEnabled { false };
+    bool m_highlightAPIEnabled { false };
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     bool m_layoutFormattingContextEnabled { false };

Modified: trunk/Source/WebKit/ChangeLog (253092 => 253093)


--- trunk/Source/WebKit/ChangeLog	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKit/ChangeLog	2019-12-04 05:48:46 UTC (rev 253093)
@@ -1,3 +1,16 @@
+2019-12-03  Megan Gardner  <megan_gard...@apple.com>
+
+        Add disabled highlight API skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=204809
+
+        Reviewed by Ryosuke Niwa.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetHighlightAPIEnabled):
+        (WKPreferencesGetHighlightAPIEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+
 2019-12-03  Ryosuke Niwa  <rn...@webkit.org>
 
         Replace customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (253092 => 253093)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-12-04 05:48:46 UTC (rev 253093)
@@ -750,6 +750,14 @@
   humanReadableDescription: "Web Gamepad API support"
   webcoreBinding: RuntimeEnabledFeatures
   condition: ENABLE(GAMEPAD)
+  
+HighlightAPIEnabled:
+    type: bool
+    defaultValue: false
+    humanReadableName: "Highlight API"
+    humanReadableDescription: "Highlight API support"
+    webcoreBinding: RuntimeEnabledFeatures
+    category: experimental
 
 InputEventsEnabled:
   type: bool

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (253092 => 253093)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2019-12-04 05:48:46 UTC (rev 253093)
@@ -1539,6 +1539,16 @@
     return toImpl(preferencesRef)->gamepadsEnabled();
 }
 
+void WKPreferencesSetHighlightAPIEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setHighlightAPIEnabled(enabled);
+}
+
+bool WKPreferencesGetHighlightAPIEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->highlightAPIEnabled();
+}
+
 // FIXME: Remove these when possible.
 void WKPreferencesSetLongMousePressEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (253092 => 253093)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -391,6 +391,10 @@
 WK_EXPORT void WKPreferencesSetGamepadsEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetGamepadsEnabled(WKPreferencesRef preferencesRef);
 
+// Default to false.
+WK_EXPORT void WKPreferencesSetHighlightAPIEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetHighlightAPIEnabled(WKPreferencesRef preferencesRef);
+
 // Not implemented, should be deleted once there are no callers.
 WK_EXPORT void WKPreferencesSetLongMousePressEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetLongMousePressEnabled(WKPreferencesRef preferencesRef);

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (253092 => 253093)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2019-12-04 05:48:46 UTC (rev 253093)
@@ -1,3 +1,19 @@
+2019-12-03  Megan Gardner  <megan_gard...@apple.com>
+
+        Add disabled highlight API skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=204809
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences highlightAPIEnabled]):
+        (-[WebPreferences setHighlightAPIEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-12-03  Eric Carlson  <eric.carl...@apple.com>
 
         Add a runtime setting for media in the GPU process

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (253092 => 253093)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -171,6 +171,7 @@
 #define WebKitShouldConvertPositionStyleOnCopyPreferenceKey @"WebKitShouldConvertPositionStyleOnCopy"
 #define WebKitImageControlsEnabledPreferenceKey @"WebKitImageControlsEnabled"
 #define WebKitGamepadsEnabledPreferenceKey @"WebKitGamepadsEnabled"
+#define WebKitHighlightAPIEnabledPreferenceKey @"WebKitHighlightAPIEnabled"
 #define WebKitServiceControlsEnabledPreferenceKey @"WebKitServiceControlsEnabled"
 #define WebKitMediaKeysStorageDirectoryKey @"WebKitMediaKeysStorageDirectory"
 #define WebKitShadowDOMEnabledPreferenceKey @"WebKitShadowDOMEnabled"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (253092 => 253093)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2019-12-04 05:48:46 UTC (rev 253093)
@@ -631,6 +631,7 @@
         @YES, WebKitDataTransferItemsEnabledPreferenceKey,
         @NO, WebKitCustomPasteboardDataEnabledPreferenceKey,
         @NO, WebKitDialogElementEnabledPreferenceKey,
+        @NO, WebKitHighlightAPIEnabledPreferenceKey,
         @YES, WebKitModernMediaControlsEnabledPreferenceKey,
         @NO, WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey,
 
@@ -2850,6 +2851,16 @@
     [self _setBoolValue:flag forKey:WebKitGamepadsEnabledPreferenceKey];
 }
 
+- (BOOL)highlightAPIEnabled
+{
+    return [self _boolValueForKey:WebKitHighlightAPIEnabledPreferenceKey];
+}
+
+- (void)setHighlightAPIEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitHighlightAPIEnabledPreferenceKey];
+}
+
 - (BOOL)shouldConvertPositionStyleOnCopy
 {
     return [self _boolValueForKey:WebKitShouldConvertPositionStyleOnCopyPreferenceKey];

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (253092 => 253093)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2019-12-04 05:48:46 UTC (rev 253093)
@@ -510,6 +510,9 @@
 - (void)setGamepadsEnabled:(BOOL)flag;
 - (BOOL)gamepadsEnabled;
 
+- (void)setHighlightAPIEnabled:(BOOL)flag;
+- (BOOL)highlightAPIEnabled;
+
 - (void)setMediaPreloadingEnabled:(BOOL)flag;
 - (BOOL)mediaPreloadingEnabled;
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (253092 => 253093)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2019-12-04 05:48:46 UTC (rev 253093)
@@ -3132,6 +3132,8 @@
     RuntimeEnabledFeatures::sharedFeatures().setGamepadsEnabled([preferences gamepadsEnabled]);
 #endif
 
+    RuntimeEnabledFeatures::sharedFeatures().setHighlightAPIEnabled([preferences highlightAPIEnabled]);
+
     RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled([preferences shadowDOMEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setDataTransferItemsEnabled([preferences dataTransferItemsEnabled]);

Modified: trunk/Tools/ChangeLog (253092 => 253093)


--- trunk/Tools/ChangeLog	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Tools/ChangeLog	2019-12-04 05:48:46 UTC (rev 253093)
@@ -1,3 +1,15 @@
+2019-12-03  Megan Gardner  <megan_gard...@apple.com>
+
+        Add disabled highlight API skeleton
+        https://bugs.webkit.org/show_bug.cgi?id=204809
+
+        Reviewed by Ryosuke Niwa.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2019-12-03  Ryosuke Niwa  <rn...@webkit.org>
 
         Replace customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (253092 => 253093)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2019-12-04 05:48:46 UTC (rev 253093)
@@ -857,6 +857,7 @@
 {
     // FIXME: SpringTimingFunction
     [preferences setGamepadsEnabled:YES];
+    [preferences setHighlightAPIEnabled:YES];
     [preferences setLinkPreloadEnabled:YES];
     [preferences setMediaPreloadingEnabled:YES];
     // FIXME: InputEvents

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (253092 => 253093)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2019-12-04 05:30:59 UTC (rev 253092)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2019-12-04 05:48:46 UTC (rev 253093)
@@ -884,6 +884,7 @@
     WKPreferencesSetMediaSourceEnabled(preferences, true);
     WKPreferencesSetSourceBufferChangeTypeEnabled(preferences, true);
 #endif
+    WKPreferencesSetHighlightAPIEnabled(preferences, true);
 
     WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled(preferences, false);
     WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(preferences, false);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to