Title: [171834] trunk/Source/WebCore
Revision
171834
Author
[email protected]
Date
2014-07-30 20:17:39 -0700 (Wed, 30 Jul 2014)

Log Message

Cleanup DetailsMarkerControl
https://bugs.webkit.org/show_bug.cgi?id=135429

Reviewed by Andreas Kling.

Remove the override of shadowPseudoId(). This is a simple type of shadowId,
it should use the generic pseudo() path.

Move DetailsMarkerControl::create() out-of-line. One could justify inlining the constructor,
inlining the ::create() function has little value.

* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::create):
(WebCore::DetailsMarkerControl::DetailsMarkerControl):
(WebCore::DetailsMarkerControl::rendererIsNeeded):
(WebCore::DetailsMarkerControl::shadowPseudoId): Deleted.
(WebCore::DetailsMarkerControl::summaryElement): Deleted.
* html/shadow/DetailsMarkerControl.h:
(WebCore::DetailsMarkerControl::create): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (171833 => 171834)


--- trunk/Source/WebCore/ChangeLog	2014-07-31 03:16:52 UTC (rev 171833)
+++ trunk/Source/WebCore/ChangeLog	2014-07-31 03:17:39 UTC (rev 171834)
@@ -1,3 +1,25 @@
+2014-07-30  Benjamin Poulain  <[email protected]>
+
+        Cleanup DetailsMarkerControl
+        https://bugs.webkit.org/show_bug.cgi?id=135429
+
+        Reviewed by Andreas Kling.
+
+        Remove the override of shadowPseudoId(). This is a simple type of shadowId,
+        it should use the generic pseudo() path.
+
+        Move DetailsMarkerControl::create() out-of-line. One could justify inlining the constructor,
+        inlining the ::create() function has little value.
+
+        * html/shadow/DetailsMarkerControl.cpp:
+        (WebCore::DetailsMarkerControl::create):
+        (WebCore::DetailsMarkerControl::DetailsMarkerControl):
+        (WebCore::DetailsMarkerControl::rendererIsNeeded):
+        (WebCore::DetailsMarkerControl::shadowPseudoId): Deleted.
+        (WebCore::DetailsMarkerControl::summaryElement): Deleted.
+        * html/shadow/DetailsMarkerControl.h:
+        (WebCore::DetailsMarkerControl::create): Deleted.
+
 2014-07-30  Benjamin Poulain  <[email protected]>
 
         Remove UploadButtonElement::shadowPseudoId()

Modified: trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp (171833 => 171834)


--- trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp	2014-07-31 03:16:52 UTC (rev 171833)
+++ trunk/Source/WebCore/html/shadow/DetailsMarkerControl.cpp	2014-07-31 03:17:39 UTC (rev 171834)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2014 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
@@ -38,11 +39,15 @@
 
 namespace WebCore {
 
-using namespace HTMLNames;
+PassRefPtr<DetailsMarkerControl> DetailsMarkerControl::create(Document& document)
+{
+    return adoptRef(new DetailsMarkerControl(document));
+}
 
 DetailsMarkerControl::DetailsMarkerControl(Document& document)
-    : HTMLDivElement(divTag, document)
+    : HTMLDivElement(HTMLNames::divTag, document)
 {
+    setPseudo(AtomicString("-webkit-details-marker", AtomicString::ConstructFromLiteral));
 }
 
 RenderPtr<RenderElement> DetailsMarkerControl::createElementRenderer(PassRef<RenderStyle> style)
@@ -52,20 +57,9 @@
 
 bool DetailsMarkerControl::rendererIsNeeded(const RenderStyle& style)
 {
-    return summaryElement()->isMainSummary() && HTMLDivElement::rendererIsNeeded(style);
+    return toHTMLSummaryElement(shadowHost())->isMainSummary() && HTMLDivElement::rendererIsNeeded(style);
 }
 
-const AtomicString& DetailsMarkerControl::shadowPseudoId() const
-{
-    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-details-marker", AtomicString::ConstructFromLiteral));
-    return pseudId;
 }
 
-HTMLSummaryElement* DetailsMarkerControl::summaryElement()
-{
-    return toHTMLSummaryElement(shadowHost());
-}
-
-}
-
 #endif

Modified: trunk/Source/WebCore/html/shadow/DetailsMarkerControl.h (171833 => 171834)


--- trunk/Source/WebCore/html/shadow/DetailsMarkerControl.h	2014-07-31 03:16:52 UTC (rev 171833)
+++ trunk/Source/WebCore/html/shadow/DetailsMarkerControl.h	2014-07-31 03:17:39 UTC (rev 171834)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2014 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
@@ -32,12 +33,9 @@
 #define DetailsMarkerControl_h
 
 #include "HTMLDivElement.h"
-#include <wtf/Forward.h>
 
 namespace WebCore {
 
-class HTMLSummaryElement;
-
 class DetailsMarkerControl final : public HTMLDivElement {
 public:
     static PassRefPtr<DetailsMarkerControl> create(Document&);
@@ -47,16 +45,8 @@
 
     virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
     virtual bool rendererIsNeeded(const RenderStyle&) override;
-    virtual const AtomicString& shadowPseudoId() const override;
-
-    HTMLSummaryElement* summaryElement();
 };
 
-inline PassRefPtr<DetailsMarkerControl> DetailsMarkerControl::create(Document& document)
-{
-    return adoptRef(new DetailsMarkerControl(document));
 }
 
-}
-
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to