Title: [162821] trunk/Source/WebCore
Revision
162821
Author
[email protected]
Date
2014-01-26 18:22:34 -0800 (Sun, 26 Jan 2014)

Log Message

Make DOMStringMap a typedef of DatasetDOMStringMap
https://bugs.webkit.org/show_bug.cgi?id=127658

Reviewed by Sam Weinig.

The only concrete implementation of DOMStringMap is DatasetDOMStringMap.
The abstract interface for a single definition is adding complexity for no gain.

This patch removes DOMStringMap and simply keeps the name through a typedef.
I used a typedef instead of just renaming DatasetDOMStringMap because I think
having both name has value. DatasetDOMStringMap is a better description of what
the implementation does. DOMStringMap is the public name and the classname is
the same as the _javascript_ type by convention.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/DOMStringMap.cpp: Removed.
* dom/DOMStringMap.h:
* dom/DatasetDOMStringMap.h:
* dom/Element.cpp:
(WebCore::Element::dataset):
* dom/Element.h:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (162820 => 162821)


--- trunk/Source/WebCore/CMakeLists.txt	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/CMakeLists.txt	2014-01-27 02:22:34 UTC (rev 162821)
@@ -1144,7 +1144,6 @@
     dom/DOMImplementation.cpp
     dom/DOMNamedFlowCollection.cpp
     dom/DOMStringList.cpp
-    dom/DOMStringMap.cpp
     dom/DataTransferItem.cpp
     dom/DatasetDOMStringMap.cpp
     dom/DecodedDataDocumentParser.cpp

Modified: trunk/Source/WebCore/ChangeLog (162820 => 162821)


--- trunk/Source/WebCore/ChangeLog	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/ChangeLog	2014-01-27 02:22:34 UTC (rev 162821)
@@ -1,3 +1,32 @@
+2014-01-26  Benjamin Poulain  <[email protected]>
+
+        Make DOMStringMap a typedef of DatasetDOMStringMap
+        https://bugs.webkit.org/show_bug.cgi?id=127658
+
+        Reviewed by Sam Weinig.
+
+        The only concrete implementation of DOMStringMap is DatasetDOMStringMap.
+        The abstract interface for a single definition is adding complexity for no gain.
+
+        This patch removes DOMStringMap and simply keeps the name through a typedef.
+        I used a typedef instead of just renaming DatasetDOMStringMap because I think
+        having both name has value. DatasetDOMStringMap is a better description of what
+        the implementation does. DOMStringMap is the public name and the classname is
+        the same as the _javascript_ type by convention.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMAllInOne.cpp:
+        * dom/DOMStringMap.cpp: Removed.
+        * dom/DOMStringMap.h:
+        * dom/DatasetDOMStringMap.h:
+        * dom/Element.cpp:
+        (WebCore::Element::dataset):
+        * dom/Element.h:
+
 2014-01-26  David Kilzer  <[email protected]>
 
         Part 2: Assertion failure in WebCore::PseudoElement::didRecalcStyle()

Modified: trunk/Source/WebCore/GNUmakefile.list.am (162820 => 162821)


--- trunk/Source/WebCore/GNUmakefile.list.am	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2014-01-27 02:22:34 UTC (rev 162821)
@@ -2824,7 +2824,6 @@
 	Source/WebCore/dom/DOMNamedFlowCollection.h \
 	Source/WebCore/dom/DOMStringList.cpp \
 	Source/WebCore/dom/DOMStringList.h \
-	Source/WebCore/dom/DOMStringMap.cpp \
 	Source/WebCore/dom/DOMStringMap.h \
 	Source/WebCore/dom/DOMTimeStamp.h \
 	Source/WebCore/dom/Element.cpp \

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (162820 => 162821)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj	2014-01-27 02:22:34 UTC (rev 162821)
@@ -12602,20 +12602,6 @@
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\dom\DOMStringMap.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\dom\Element.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (162820 => 162821)


--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters	2014-01-27 02:22:34 UTC (rev 162821)
@@ -3126,9 +3126,6 @@
     <ClCompile Include="..\dom\DOMStringList.cpp">
       <Filter>dom</Filter>
     </ClCompile>
-    <ClCompile Include="..\dom\DOMStringMap.cpp">
-      <Filter>dom</Filter>
-    </ClCompile>
     <ClCompile Include="..\dom\Element.cpp">
       <Filter>dom</Filter>
     </ClCompile>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (162820 => 162821)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-01-27 02:22:34 UTC (rev 162821)
@@ -5027,7 +5027,6 @@
 		BC60DA5B0D2A31F700B9918F /* XPathException.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60DA590D2A31F700B9918F /* XPathException.h */; };
 		BC60DB490D2A3D1E00B9918F /* JSXPathException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60DB470D2A3D1E00B9918F /* JSXPathException.cpp */; };
 		BC60DB4A0D2A3D1E00B9918F /* JSXPathException.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60DB480D2A3D1E00B9918F /* JSXPathException.h */; };
-		BC64640911D7F304006455B0 /* DOMStringMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64640711D7F304006455B0 /* DOMStringMap.cpp */; };
 		BC64640A11D7F304006455B0 /* DOMStringMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64640811D7F304006455B0 /* DOMStringMap.h */; };
 		BC64641C11D7F416006455B0 /* DatasetDOMStringMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC64641A11D7F416006455B0 /* DatasetDOMStringMap.h */; };
 		BC64641D11D7F416006455B0 /* DatasetDOMStringMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64641B11D7F416006455B0 /* DatasetDOMStringMap.cpp */; };
@@ -12205,7 +12204,6 @@
 		BC60DA5A0D2A31F700B9918F /* XPathException.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XPathException.idl; sourceTree = "<group>"; };
 		BC60DB470D2A3D1E00B9918F /* JSXPathException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathException.cpp; sourceTree = "<group>"; };
 		BC60DB480D2A3D1E00B9918F /* JSXPathException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSXPathException.h; sourceTree = "<group>"; };
-		BC64640711D7F304006455B0 /* DOMStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMStringMap.cpp; sourceTree = "<group>"; };
 		BC64640811D7F304006455B0 /* DOMStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringMap.h; sourceTree = "<group>"; };
 		BC64641A11D7F416006455B0 /* DatasetDOMStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatasetDOMStringMap.h; sourceTree = "<group>"; };
 		BC64641B11D7F416006455B0 /* DatasetDOMStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatasetDOMStringMap.cpp; sourceTree = "<group>"; };
@@ -21928,7 +21926,6 @@
 				C55610F011A704EB00B82D27 /* DOMStringList.cpp */,
 				C544274911A57E7A0063A749 /* DOMStringList.h */,
 				C544274A11A57E7A0063A749 /* DOMStringList.idl */,
-				BC64640711D7F304006455B0 /* DOMStringMap.cpp */,
 				BC64640811D7F304006455B0 /* DOMStringMap.h */,
 				BC64647911D800CD006455B0 /* DOMStringMap.idl */,
 				05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */,
@@ -26814,7 +26811,6 @@
 				BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */,
 				4ACBC0C312713CCA0094F9B2 /* DOMSettableTokenList.cpp in Sources */,
 				C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */,
-				BC64640911D7F304006455B0 /* DOMStringMap.cpp in Sources */,
 				0FF5025C102BA9010066F39A /* DOMStyleMedia.mm in Sources */,
 				850657010AAB4763002D15C0 /* DOMStyleSheet.mm in Sources */,
 				850657030AAB4763002D15C0 /* DOMStyleSheetList.mm in Sources */,

Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (162820 => 162821)


--- trunk/Source/WebCore/dom/DOMAllInOne.cpp	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp	2014-01-27 02:22:34 UTC (rev 162821)
@@ -49,7 +49,6 @@
 #include "DOMImplementation.cpp"
 #include "DOMNamedFlowCollection.cpp"
 #include "DOMStringList.cpp"
-#include "DOMStringMap.cpp"
 #include "DatasetDOMStringMap.cpp"
 #include "DecodedDataDocumentParser.cpp"
 #include "DeviceMotionController.cpp"

Deleted: trunk/Source/WebCore/dom/DOMStringMap.cpp (162820 => 162821)


--- trunk/Source/WebCore/dom/DOMStringMap.cpp	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/dom/DOMStringMap.cpp	2014-01-27 02:22:34 UTC (rev 162821)
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2010 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 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 "DOMStringMap.h"
-
-namespace WebCore {
-
-DOMStringMap::DOMStringMap()
-{
-}
-
-DOMStringMap::~DOMStringMap()
-{
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/dom/DOMStringMap.h (162820 => 162821)


--- trunk/Source/WebCore/dom/DOMStringMap.h	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/dom/DOMStringMap.h	2014-01-27 02:22:34 UTC (rev 162821)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -26,36 +26,12 @@
 #ifndef DOMStringMap_h
 #define DOMStringMap_h
 
-#include "ScriptWrappable.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
+#include "DatasetDOMStringMap.h"
 
 namespace WebCore {
 
-class Element;
-typedef int ExceptionCode;
+typedef DatasetDOMStringMap DOMStringMap;
 
-class DOMStringMap : public ScriptWrappable {
-    WTF_MAKE_NONCOPYABLE(DOMStringMap); WTF_MAKE_FAST_ALLOCATED;
-public:
-    virtual ~DOMStringMap();
-
-    virtual void ref() = 0;
-    virtual void deref() = 0;
-
-    virtual void getNames(Vector<String>&) = 0;
-    virtual String item(const String& name) = 0;
-    virtual bool contains(const String& name) = 0;
-    virtual void setItem(const String& name, const String& value, ExceptionCode&) = 0;
-    virtual void deleteItem(const String& name, ExceptionCode&) = 0;
-
-    virtual Element* element() = 0;
-
-protected:
-    DOMStringMap();
-};
-
 } // namespace WebCore
 
 #endif // DOMStringMap_h

Modified: trunk/Source/WebCore/dom/DatasetDOMStringMap.h (162820 => 162821)


--- trunk/Source/WebCore/dom/DatasetDOMStringMap.h	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/dom/DatasetDOMStringMap.h	2014-01-27 02:22:34 UTC (rev 162821)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 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
@@ -26,29 +26,34 @@
 #ifndef DatasetDOMStringMap_h
 #define DatasetDOMStringMap_h
 
-#include "DOMStringMap.h"
+#include "ScriptWrappable.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
 class Element;
+typedef int ExceptionCode;
 
-class DatasetDOMStringMap final : public DOMStringMap {
+class DatasetDOMStringMap final : public ScriptWrappable {
+    WTF_MAKE_NONCOPYABLE(DatasetDOMStringMap); WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit DatasetDOMStringMap(Element& element)
         : m_element(element)
     {
     }
 
-    virtual void ref() override;
-    virtual void deref() override;
+    void ref();
+    void deref();
 
-    virtual void getNames(Vector<String>&) override;
-    virtual String item(const String& name) override;
-    virtual bool contains(const String& name) override;
-    virtual void setItem(const String& name, const String& value, ExceptionCode&) override;
-    virtual void deleteItem(const String& name, ExceptionCode&) override;
+    void getNames(Vector<String>&);
+    String item(const String& name);
+    bool contains(const String& name);
+    void setItem(const String& name, const String& value, ExceptionCode&);
+    void deleteItem(const String& name, ExceptionCode&);
 
-    virtual Element* element() override { return &m_element; }
+    Element* element() { return &m_element; }
 
 private:
     Element& m_element;

Modified: trunk/Source/WebCore/dom/Element.cpp (162820 => 162821)


--- trunk/Source/WebCore/dom/Element.cpp	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/dom/Element.cpp	2014-01-27 02:22:34 UTC (rev 162821)
@@ -2436,7 +2436,7 @@
     return data.classList();
 }
 
-DOMStringMap* Element::dataset()
+DatasetDOMStringMap* Element::dataset()
 {
     ElementRareData& data = ""
     if (!data.dataset())

Modified: trunk/Source/WebCore/dom/Element.h (162820 => 162821)


--- trunk/Source/WebCore/dom/Element.h	2014-01-27 01:34:45 UTC (rev 162820)
+++ trunk/Source/WebCore/dom/Element.h	2014-01-27 02:22:34 UTC (rev 162821)
@@ -37,7 +37,7 @@
 
 class ClientRect;
 class ClientRectList;
-class DOMStringMap;
+class DatasetDOMStringMap;
 class DOMTokenList;
 class ElementRareData;
 class HTMLDocument;
@@ -459,7 +459,7 @@
 
     DOMTokenList* classList();
 
-    DOMStringMap* dataset();
+    DatasetDOMStringMap* dataset();
 
 #if ENABLE(VIDEO)
     virtual bool isMediaElement() const { return false; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to