Title: [261510] branches/safari-609-branch/Source/WebCore
Revision
261510
Author
[email protected]
Date
2020-05-11 17:21:24 -0700 (Mon, 11 May 2020)

Log Message

Cherry-pick r259353. rdar://problem/62978934

    Don't use raw pointers in ShadowRoot.
    https://bugs.webkit.org/show_bug.cgi?id=209843
    <rdar://problem/61069603>

    Reviewed by Brent Fulgham.

    * dom/Element.cpp:
    (WebCore::Element::addShadowRoot):
    * dom/ShadowRoot.h:

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

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (261509 => 261510)


--- branches/safari-609-branch/Source/WebCore/ChangeLog	2020-05-12 00:21:21 UTC (rev 261509)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog	2020-05-12 00:21:24 UTC (rev 261510)
@@ -1,5 +1,34 @@
 2020-05-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r259353. rdar://problem/62978934
+
+    Don't use raw pointers in ShadowRoot.
+    https://bugs.webkit.org/show_bug.cgi?id=209843
+    <rdar://problem/61069603>
+    
+    Reviewed by Brent Fulgham.
+    
+    * dom/Element.cpp:
+    (WebCore::Element::addShadowRoot):
+    * dom/ShadowRoot.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-01  Jer Noble  <[email protected]>
+
+            Don't use raw pointers in ShadowRoot.
+            https://bugs.webkit.org/show_bug.cgi?id=209843
+            <rdar://problem/61069603>
+
+            Reviewed by Brent Fulgham.
+
+            * dom/Element.cpp:
+            (WebCore::Element::addShadowRoot):
+            * dom/ShadowRoot.h:
+
+2020-05-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r259348. rdar://problem/62978878
 
     Notify accessibility when a node is removed from its ancestor.

Modified: branches/safari-609-branch/Source/WebCore/dom/Element.cpp (261509 => 261510)


--- branches/safari-609-branch/Source/WebCore/dom/Element.cpp	2020-05-12 00:21:21 UTC (rev 261509)
+++ branches/safari-609-branch/Source/WebCore/dom/Element.cpp	2020-05-12 00:21:24 UTC (rev 261510)
@@ -2287,7 +2287,7 @@
 
         ensureElementRareData().setShadowRoot(WTFMove(newShadowRoot));
 
-        shadowRoot.setHost(this);
+        shadowRoot.setHost(makeWeakPtr<Element>(this));
         shadowRoot.setParentTreeScope(treeScope());
 
 #if !ASSERT_DISABLED

Modified: branches/safari-609-branch/Source/WebCore/dom/ShadowRoot.h (261509 => 261510)


--- branches/safari-609-branch/Source/WebCore/dom/ShadowRoot.h	2020-05-12 00:21:21 UTC (rev 261509)
+++ branches/safari-609-branch/Source/WebCore/dom/ShadowRoot.h	2020-05-12 00:21:24 UTC (rev 261510)
@@ -71,8 +71,8 @@
     bool containsFocusedElement() const { return m_containsFocusedElement; }
     void setContainsFocusedElement(bool flag) { m_containsFocusedElement = flag; }
 
-    Element* host() const { return m_host; }
-    void setHost(Element* host) { m_host = host; }
+    Element* host() const { return m_host.get(); }
+    void setHost(WeakPtr<Element>&& host) { m_host = WTFMove(host); }
 
     String innerHTML() const;
     ExceptionOr<void> setInnerHTML(const String&);
@@ -130,7 +130,7 @@
     bool m_containsFocusedElement { false };
     ShadowRootMode m_type { ShadowRootMode::UserAgent };
 
-    Element* m_host { nullptr };
+    WeakPtr<Element> m_host;
     RefPtr<StyleSheetList> m_styleSheetList;
 
     std::unique_ptr<Style::Scope> m_styleScope;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to