Title: [212393] trunk/Source/WebCore
Revision
212393
Author
[email protected]
Date
2017-02-15 13:50:10 -0800 (Wed, 15 Feb 2017)

Log Message

Editing history scripts should not add the contenteditable attribute or override key events
https://bugs.webkit.org/show_bug.cgi?id=168389
<rdar://problem/30529945>

Reviewed by Dan Bernstein.

Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
events. These were initially added for compatibility with a test harness early on, and should have been removed
earlier.

* Scripts/DumpEditingHistory.js:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (212392 => 212393)


--- trunk/Source/WebCore/ChangeLog	2017-02-15 21:22:37 UTC (rev 212392)
+++ trunk/Source/WebCore/ChangeLog	2017-02-15 21:50:10 UTC (rev 212393)
@@ -1,3 +1,18 @@
+2017-02-15  Wenson Hsieh  <[email protected]>
+
+        Editing history scripts should not add the contenteditable attribute or override key events
+        https://bugs.webkit.org/show_bug.cgi?id=168389
+        <rdar://problem/30529945>
+
+        Reviewed by Dan Bernstein.
+
+        Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
+        rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
+        events. These were initially added for compatibility with a test harness early on, and should have been removed
+        earlier.
+
+        * Scripts/DumpEditingHistory.js:
+
 2017-02-15  Jer Noble  <[email protected]>
 
         Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary

Modified: trunk/Source/WebCore/Scripts/DumpEditingHistory.js (212392 => 212393)


--- trunk/Source/WebCore/Scripts/DumpEditingHistory.js	2017-02-15 21:22:37 UTC (rev 212392)
+++ trunk/Source/WebCore/Scripts/DumpEditingHistory.js	2017-02-15 21:50:10 UTC (rev 212393)
@@ -41,7 +41,6 @@
         lastKnownSelectionState = newSelectionState;
     }
 
-    document.body.setAttribute("contenteditable", true);
     document.body.addEventListener("focus", () => {
         if (initialized)
             return;
@@ -58,6 +57,7 @@
         document.addEventListener("selectionchange", () => {
             appendSelectionUpdateIfNecessary();
         });
+
         document.addEventListener("beforeinput", event => {
             appendDOMUpdatesFromRecords(mutationObserver.takeRecords());
             beginProcessingTopLevelUpdate();
@@ -70,17 +70,6 @@
             endProcessingTopLevelUpdate(new EditingHistory.InputEventUpdate(globalNodeMap, currentChildUpdates, event.inputType, eventData, event.timeStamp));
         });
 
-        document.addEventListener("keydown", event => {
-            if (event.key !== "s" || !event.metaKey)
-                return;
-
-            let fakeLink = document.createElement("a");
-            fakeLink.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(EditingHistory.getEditingHistoryAsJSONString()));
-            fakeLink.setAttribute("download", "record.json");
-            fakeLink.click();
-            event.preventDefault();
-        });
-
         mutationObserver.observe(document, {
             childList: true,
             attributes: true,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to