Title: [288283] releases/WebKitGTK/webkit-2.34
Revision
288283
Author
[email protected]
Date
2022-01-20 06:13:02 -0800 (Thu, 20 Jan 2022)

Log Message

Merge r287131 - Mark range boundary point containers
https://bugs.webkit.org/show_bug.cgi?id=233462

Patch by Rob Buis <[email protected]> on 2021-12-16
Reviewed by Darin Adler.

Source/WebCore:

Mark range boundary point containers as unreachable for gc.

Test: fast/dom/Range/delete-contents-crash.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSRangeCustom.cpp: Added.
(WebCore::JSRange::visitAdditionalChildren):
* dom/Range.cpp:
(WebCore::Range::visitNodesConcurrently const):
* dom/Range.h:
* dom/Range.idl:

LayoutTests:

* fast/dom/Range/delete-contents-crash-expected.txt: Added.
* fast/dom/Range/delete-contents-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.34/LayoutTests/ChangeLog (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/LayoutTests/ChangeLog	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/LayoutTests/ChangeLog	2022-01-20 14:13:02 UTC (rev 288283)
@@ -1,3 +1,13 @@
+2021-12-16  Rob Buis  <[email protected]>
+
+        Mark range boundary point containers
+        https://bugs.webkit.org/show_bug.cgi?id=233462
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/Range/delete-contents-crash-expected.txt: Added.
+        * fast/dom/Range/delete-contents-crash.html: Added.
+
 2021-12-15  Gabriel Nava Marino  <[email protected]>
 
         null ptr deref in WebCore::ApplyStyleCommand::applyRelativeFontStyleChange

Added: releases/WebKitGTK/webkit-2.34/LayoutTests/fast/dom/Range/delete-contents-crash-expected.txt (0 => 288283)


--- releases/WebKitGTK/webkit-2.34/LayoutTests/fast/dom/Range/delete-contents-crash-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.34/LayoutTests/fast/dom/Range/delete-contents-crash-expected.txt	2022-01-20 14:13:02 UTC (rev 288283)
@@ -0,0 +1 @@
+PASS: Test did not crash.

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog	2022-01-20 14:13:02 UTC (rev 288283)
@@ -1,3 +1,23 @@
+2021-12-16  Rob Buis  <[email protected]>
+
+        Mark range boundary point containers
+        https://bugs.webkit.org/show_bug.cgi?id=233462
+
+        Reviewed by Darin Adler.
+
+        Mark range boundary point containers as unreachable for gc.
+
+        Test: fast/dom/Range/delete-contents-crash.html
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSRangeCustom.cpp: Added.
+        (WebCore::JSRange::visitAdditionalChildren):
+        * dom/Range.cpp:
+        (WebCore::Range::visitNodesConcurrently const):
+        * dom/Range.h:
+        * dom/Range.idl:
+
 2021-12-15  Gabriel Nava Marino  <[email protected]>
 
         null ptr deref in WebCore::ApplyStyleCommand::applyRelativeFontStyleChange

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/Sources.txt (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/Sources.txt	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/Sources.txt	2022-01-20 14:13:02 UTC (rev 288283)
@@ -518,6 +518,7 @@
 bindings/js/JSPopStateEventCustom.cpp
 bindings/js/JSPromiseRejectionEventCustom.cpp
 bindings/js/JSRTCRtpSFrameTransformCustom.cpp
+bindings/js/JSRangeCustom.cpp
 bindings/js/JSReadableStreamSourceCustom.cpp
 bindings/js/JSRemoteDOMWindowBase.cpp
 bindings/js/JSRemoteDOMWindowCustom.cpp

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/WebCore.xcodeproj/project.pbxproj (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-01-20 14:13:02 UTC (rev 288283)
@@ -8248,6 +8248,7 @@
 		445210DD25D61EFF003A2ED8 /* AppHighlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppHighlight.h; sourceTree = "<group>"; };
 		445775E420472F73008DCE5D /* LocalDefaultSystemAppearance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalDefaultSystemAppearance.h; sourceTree = "<group>"; };
 		445775E92047303B008DCE5D /* LocalDefaultSystemAppearance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalDefaultSystemAppearance.mm; sourceTree = "<group>"; };
+		4469587A276B3A9000449C2D /* JSRangeCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSRangeCustom.cpp; sourceTree = "<group>"; };
 		446DC64624A29D9B0061F390 /* PlaybackTargetClientContextIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlaybackTargetClientContextIdentifier.h; sourceTree = "<group>"; };
 		446EE4E8255E0D9200454463 /* LocalizableAdditions.strings.out */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; fileEncoding = 4; name = LocalizableAdditions.strings.out; path = DerivedSources/WebCore/en.lproj/LocalizableAdditions.strings.out; sourceTree = BUILT_PRODUCTS_DIR; };
 		4471710B205AF945000A116E /* MediaQueryParserContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaQueryParserContext.cpp; sourceTree = "<group>"; };
@@ -22757,6 +22758,7 @@
 				CB38FD551CD21D5B00592A3F /* JSPerformanceEntryCustom.cpp */,
 				833CF70F20DB3F5F00141BCC /* JSPerformanceObserverCustom.cpp */,
 				A4A69B8BB91B49D0A804C31D /* JSPromiseRejectionEventCustom.cpp */,
+				4469587A276B3A9000449C2D /* JSRangeCustom.cpp */,
 				5868C7C42539DA3300BF9DF3 /* JSResizeObserverCustom.cpp */,
 				5884FE5622813E2D0040AFF6 /* JSResizeObserverEntryCustom.cpp */,
 				83F572941FA1066F003837BE /* JSServiceWorkerClientCustom.cpp */,
@@ -33869,6 +33871,7 @@
 				312C0C41146DC6CC0016C911 /* Notification.h in Headers */,
 				33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */,
 				3128CA6B147331630074C72A /* NotificationController.h in Headers */,
+				51123E2F276940CA00F9D41B /* NotificationData.h in Headers */,
 				7CC2DE031ECA04A50027B774 /* NotificationDirection.h in Headers */,
 				7CC2DDFB1EC9415A0027B774 /* NotificationPermission.h in Headers */,
 				31FE6DFA15004C2A0004EBC4 /* NotificationPermissionCallback.h in Headers */,

Added: releases/WebKitGTK/webkit-2.34/Source/WebCore/bindings/js/JSRangeCustom.cpp (0 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/bindings/js/JSRangeCustom.cpp	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/bindings/js/JSRangeCustom.cpp	2022-01-20 14:13:02 UTC (rev 288283)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2021 Igalia S.L. 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 "JSRange.h"
+
+#include "Range.h"
+
+namespace WebCore {
+
+template<typename Visitor>
+void JSRange::visitAdditionalChildren(Visitor& visitor)
+{
+    wrapped().visitNodesConcurrently(visitor);
+}
+
+DEFINE_VISIT_ADDITIONAL_CHILDREN(JSRange);
+
+} // namespace WebCore

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.cpp (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.cpp	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.cpp	2022-01-20 14:13:02 UTC (rev 288283)
@@ -37,6 +37,7 @@
 #include "HTMLBodyElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLNames.h"
+#include "JSNode.h"
 #include "NodeTraversal.h"
 #include "NodeWithIndex.h"
 #include "ProcessingInstruction.h"
@@ -1099,6 +1100,12 @@
     return createLiveRange(*range);
 }
 
+void Range::visitNodesConcurrently(JSC::AbstractSlotVisitor& visitor) const
+{
+    visitor.addOpaqueRoot(root(&m_start.container()));
+    visitor.addOpaqueRoot(root(&m_end.container()));
+}
+
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.h (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.h	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.h	2022-01-20 14:13:02 UTC (rev 288283)
@@ -115,6 +115,8 @@
     String debugDescription() const;
 #endif
 
+    void visitNodesConcurrently(JSC::AbstractSlotVisitor&) const;
+
     enum ActionType : uint8_t { Delete, Extract, Clone };
 
 private:

Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.idl (288282 => 288283)


--- releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.idl	2022-01-20 13:53:16 UTC (rev 288282)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/dom/Range.idl	2022-01-20 14:13:02 UTC (rev 288283)
@@ -22,6 +22,7 @@
     GenerateIsReachable=ReachableFromDOMWindow,
     ExportMacro=WEBCORE_EXPORT,
     Exposed=Window,
+    JSCustomMarkFunction,
     JSGenerateToNativeObject,
 ] interface Range : AbstractRange {
     [CallWith=Document] constructor();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to