Title: [158368] trunk/Source/WebCore
Revision
158368
Author
[email protected]
Date
2013-10-31 10:41:05 -0700 (Thu, 31 Oct 2013)

Log Message

Pass an Element by reference to the PseudoElement constructor
https://bugs.webkit.org/show_bug.cgi?id=123576

Reviewed by Andreas Kling.

* dom/Element.cpp:
(WebCore::Element::createPseudoElementIfNeeded):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::PseudoElement):
* dom/PseudoElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (158367 => 158368)


--- trunk/Source/WebCore/ChangeLog	2013-10-31 17:39:56 UTC (rev 158367)
+++ trunk/Source/WebCore/ChangeLog	2013-10-31 17:41:05 UTC (rev 158368)
@@ -1,3 +1,16 @@
+2013-10-31  Sam Weinig  <[email protected]>
+
+        Pass an Element by reference to the PseudoElement constructor
+        https://bugs.webkit.org/show_bug.cgi?id=123576
+
+        Reviewed by Andreas Kling.
+
+        * dom/Element.cpp:
+        (WebCore::Element::createPseudoElementIfNeeded):
+        * dom/PseudoElement.cpp:
+        (WebCore::PseudoElement::PseudoElement):
+        * dom/PseudoElement.h:
+
 2013-10-31  Alexey Proskuryakov  <[email protected]>
 
         Fix a mis-merge.

Modified: trunk/Source/WebCore/dom/Element.cpp (158367 => 158368)


--- trunk/Source/WebCore/dom/Element.cpp	2013-10-31 17:39:56 UTC (rev 158367)
+++ trunk/Source/WebCore/dom/Element.cpp	2013-10-31 17:41:05 UTC (rev 158368)
@@ -2411,7 +2411,7 @@
         return 0;
     if (!pseudoElementRendererIsNeeded(renderer()->getCachedPseudoStyle(pseudoId)))
         return 0;
-    RefPtr<PseudoElement> pseudoElement = PseudoElement::create(this, pseudoId);
+    RefPtr<PseudoElement> pseudoElement = PseudoElement::create(*this, pseudoId);
     Style::attachRenderTree(*pseudoElement);
     return pseudoElement.release();
 }

Modified: trunk/Source/WebCore/dom/PseudoElement.cpp (158367 => 158368)


--- trunk/Source/WebCore/dom/PseudoElement.cpp	2013-10-31 17:39:56 UTC (rev 158367)
+++ trunk/Source/WebCore/dom/PseudoElement.cpp	2013-10-31 17:41:05 UTC (rev 158368)
@@ -55,9 +55,9 @@
     }
 }
 
-PseudoElement::PseudoElement(Element* host, PseudoId pseudoId)
-    : Element(pseudoElementTagName(), host->document(), CreatePseudoElement)
-    , m_hostElement(host)
+PseudoElement::PseudoElement(Element& host, PseudoId pseudoId)
+    : Element(pseudoElementTagName(), host.document(), CreatePseudoElement)
+    , m_hostElement(&host)
     , m_pseudoId(pseudoId)
 {
     ASSERT(pseudoId == BEFORE || pseudoId == AFTER);

Modified: trunk/Source/WebCore/dom/PseudoElement.h (158367 => 158368)


--- trunk/Source/WebCore/dom/PseudoElement.h	2013-10-31 17:39:56 UTC (rev 158367)
+++ trunk/Source/WebCore/dom/PseudoElement.h	2013-10-31 17:41:05 UTC (rev 158368)
@@ -36,7 +36,7 @@
 
 class PseudoElement FINAL : public Element {
 public:
-    static PassRefPtr<PseudoElement> create(Element* host, PseudoId pseudoId)
+    static PassRefPtr<PseudoElement> create(Element& host, PseudoId pseudoId)
     {
         return adoptRef(new PseudoElement(host, pseudoId));
     }
@@ -61,7 +61,7 @@
     static String pseudoElementNameForEvents(PseudoId);
 
 private:
-    PseudoElement(Element*, PseudoId);
+    PseudoElement(Element&, PseudoId);
 
     virtual void didRecalcStyle(Style::Change) OVERRIDE;
     virtual PseudoId customPseudoId() const OVERRIDE { return m_pseudoId; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to