Title: [141002] trunk/Source/WebCore
Revision
141002
Author
[email protected]
Date
2013-01-28 13:36:13 -0800 (Mon, 28 Jan 2013)

Log Message

Move ensureUserAgentShadowRoot to Element
https://bugs.webkit.org/show_bug.cgi?id=108070

Reviewed by Dimitri Glazkov.

Move ensureUserAgentShadowRoot to Element where the other
methods related to shadow roots are and get rid of the
unnecessarily specific cast to HTMLElement.

No new tests, just refactoring.

* dom/Element.cpp:
(WebCore::Element::ensureUserAgentShadowRoot): Moved from FormAssociatedElement.
* dom/Element.h:
(Element):
* html/FormAssociatedElement.cpp:
* html/FormAssociatedElement.h:
(FormAssociatedElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141001 => 141002)


--- trunk/Source/WebCore/ChangeLog	2013-01-28 21:24:21 UTC (rev 141001)
+++ trunk/Source/WebCore/ChangeLog	2013-01-28 21:36:13 UTC (rev 141002)
@@ -1,3 +1,24 @@
+2013-01-28  Elliott Sprehn  <[email protected]>
+
+        Move ensureUserAgentShadowRoot to Element
+        https://bugs.webkit.org/show_bug.cgi?id=108070
+
+        Reviewed by Dimitri Glazkov.
+
+        Move ensureUserAgentShadowRoot to Element where the other
+        methods related to shadow roots are and get rid of the
+        unnecessarily specific cast to HTMLElement.
+
+        No new tests, just refactoring.
+
+        * dom/Element.cpp:
+        (WebCore::Element::ensureUserAgentShadowRoot): Moved from FormAssociatedElement.
+        * dom/Element.h:
+        (Element):
+        * html/FormAssociatedElement.cpp:
+        * html/FormAssociatedElement.h:
+        (FormAssociatedElement):
+
 2013-01-28  Ian Vollick  <[email protected]>
 
         Promote composited-scrolling layers to stacking containers.

Modified: trunk/Source/WebCore/dom/Element.cpp (141001 => 141002)


--- trunk/Source/WebCore/dom/Element.cpp	2013-01-28 21:24:21 UTC (rev 141001)
+++ trunk/Source/WebCore/dom/Element.cpp	2013-01-28 21:36:13 UTC (rev 141002)
@@ -1488,6 +1488,13 @@
     return 0;
 }
 
+ShadowRoot* Element::ensureUserAgentShadowRoot()
+{
+    if (ShadowRoot* shadowRoot = userAgentShadowRoot())
+        return shadowRoot;
+    return ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION).get();
+}
+
 const AtomicString& Element::shadowPseudoId() const
 {
     return pseudo();

Modified: trunk/Source/WebCore/dom/Element.h (141001 => 141002)


--- trunk/Source/WebCore/dom/Element.h	2013-01-28 21:24:21 UTC (rev 141001)
+++ trunk/Source/WebCore/dom/Element.h	2013-01-28 21:36:13 UTC (rev 141002)
@@ -297,6 +297,7 @@
     virtual bool areAuthorShadowsAllowed() const { return true; }
 
     ShadowRoot* userAgentShadowRoot() const;
+    ShadowRoot* ensureUserAgentShadowRoot();
 
     virtual const AtomicString& shadowPseudoId() const;
 

Modified: trunk/Source/WebCore/html/FormAssociatedElement.cpp (141001 => 141002)


--- trunk/Source/WebCore/html/FormAssociatedElement.cpp	2013-01-28 21:24:21 UTC (rev 141001)
+++ trunk/Source/WebCore/html/FormAssociatedElement.cpp	2013-01-28 21:36:13 UTC (rev 141002)
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "FormAssociatedElement.h"
 
-#include "ElementShadow.h"
 #include "FormController.h"
 #include "HTMLFormControlElement.h"
 #include "HTMLFormElement.h"
@@ -68,15 +67,6 @@
     return m_validityState.get();
 }
 
-ShadowRoot* FormAssociatedElement::ensureUserAgentShadowRoot()
-{
-    Element* element = toHTMLElement(this);
-    if (ShadowRoot* shadowRoot = element->userAgentShadowRoot())
-        return shadowRoot;
-
-    return ShadowRoot::create(element, ShadowRoot::UserAgentShadowRoot, ASSERT_NO_EXCEPTION).get();
-}
-
 void FormAssociatedElement::didMoveToNewDocument(Document* oldDocument)
 {
     HTMLElement* element = toHTMLElement(this);

Modified: trunk/Source/WebCore/html/FormAssociatedElement.h (141001 => 141002)


--- trunk/Source/WebCore/html/FormAssociatedElement.h	2013-01-28 21:24:21 UTC (rev 141001)
+++ trunk/Source/WebCore/html/FormAssociatedElement.h	2013-01-28 21:36:13 UTC (rev 141002)
@@ -35,7 +35,6 @@
 class HTMLElement;
 class HTMLFormElement;
 class Node;
-class ShadowRoot;
 class ValidationMessage;
 class ValidityState;
 class VisibleSelection;
@@ -51,8 +50,6 @@
     HTMLFormElement* form() const { return m_form; }
     ValidityState* validity();
 
-    ShadowRoot* ensureUserAgentShadowRoot();
-
     virtual bool isFormControlElement() const = 0;
     virtual bool isFormControlElementWithState() const;
     virtual bool isEnumeratable() const = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to