Diff
Modified: trunk/Source/WebCore/ChangeLog (188752 => 188753)
--- trunk/Source/WebCore/ChangeLog 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/ChangeLog 2015-08-21 08:28:07 UTC (rev 188753)
@@ -1,3 +1,23 @@
+2015-08-21 Chris Dumez <[email protected]>
+
+ Drop NodeListBase class
+ https://bugs.webkit.org/show_bug.cgi?id=148290
+
+ Reviewed by Ryosuke Niwa.
+
+ Drop NodeListBase class and have HTMLCollection subclass NodeList
+ directly. There is no reason we need another base class.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ (GetImplClassName): Deleted.
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::getElementsByClassNameForObjC):
+ * dom/ContainerNode.h:
+ * dom/NodeList.h:
+ * dom/NodeListBase.h: Removed.
+ * html/HTMLCollection.h:
+
2015-08-20 Yusuke Suzuki <[email protected]>
[ES6] prototyping module loader in JSC shell
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (188752 => 188753)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2015-08-21 08:28:07 UTC (rev 188753)
@@ -2690,7 +2690,6 @@
8386A97019F61E4F00E1EC4A /* StyleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8386A96E19F61E4F00E1EC4A /* StyleBuilder.cpp */; };
839AAFEC1A0C0C8D00605F99 /* HTMLWBRElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */; };
839AAFED1A0C0C8D00605F99 /* HTMLWBRElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */; };
- 83AAE64A1B85816B009FAF70 /* NodeListBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AAE6491B858168009FAF70 /* NodeListBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
83B9687B19F8AB83004EF7AF /* StyleBuilderConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */; };
83C05A5A1A686212007E5DEA /* StylePropertyShorthandFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */; };
83C05A5B1A686212007E5DEA /* StylePropertyShorthandFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */; };
@@ -10055,7 +10054,6 @@
8386A96E19F61E4F00E1EC4A /* StyleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleBuilder.cpp; sourceTree = "<group>"; };
839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLWBRElement.cpp; sourceTree = "<group>"; };
839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLWBRElement.h; sourceTree = "<group>"; };
- 83AAE6491B858168009FAF70 /* NodeListBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeListBase.h; sourceTree = "<group>"; };
83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderConverter.h; sourceTree = "<group>"; };
83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StylePropertyShorthandFunctions.cpp; sourceTree = "<group>"; };
83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StylePropertyShorthandFunctions.h; sourceTree = "<group>"; };
@@ -23404,7 +23402,6 @@
1A750D870A90E394000FF215 /* NodeIterator.idl */,
A81872100977D3C0005826D9 /* NodeList.h */,
85ACA9FA0A9B631000671E90 /* NodeList.idl */,
- 83AAE6491B858168009FAF70 /* NodeListBase.h */,
7CEAC1081B483D7F00334482 /* NodeOrString.cpp */,
7CEAC1061B483D1D00334482 /* NodeOrString.h */,
4FAB48661643A67E00F70C07 /* NodeRareData.cpp */,
@@ -26236,7 +26233,6 @@
1477E7770BF4134A00152872 /* PageCache.h in Headers */,
CD5E5B5F1A15CE54000C609E /* PageConfiguration.h in Headers */,
F3820893147D35F90010BC06 /* PageConsoleAgent.h in Headers */,
- 83AAE64A1B85816B009FAF70 /* NodeListBase.h in Headers */,
DAED203116F244480070EC0F /* PageConsoleClient.h in Headers */,
A5A2AF0C1829734300DE1729 /* PageDebuggable.h in Headers */,
F34742DD134362F000531BC2 /* PageDebuggerAgent.h in Headers */,
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (188752 => 188753)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm 2015-08-21 08:28:07 UTC (rev 188753)
@@ -420,7 +420,6 @@
{
my $name = shift;
- return "NodeListBase" if $name eq "NodeList";
return "DOMWindow" if $name eq "AbstractView";
return $name;
}
Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (188752 => 188753)
--- trunk/Source/WebCore/dom/ContainerNode.cpp 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp 2015-08-21 08:28:07 UTC (rev 188753)
@@ -895,7 +895,7 @@
return ensureRareData().ensureNodeLists().addCachedCollection<ClassCollection>(*this, ByClass, classNames);
}
-RefPtr<NodeListBase> ContainerNode::getElementsByClassNameForObjC(const AtomicString& classNames)
+RefPtr<NodeList> ContainerNode::getElementsByClassNameForObjC(const AtomicString& classNames)
{
return getElementsByClassName(classNames);
}
Modified: trunk/Source/WebCore/dom/ContainerNode.h (188752 => 188753)
--- trunk/Source/WebCore/dom/ContainerNode.h 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/dom/ContainerNode.h 2015-08-21 08:28:07 UTC (rev 188753)
@@ -31,7 +31,7 @@
namespace WebCore {
class HTMLCollection;
-class NodeListBase;
+class NodeList;
class NodeOrString;
class QualifiedName;
class RenderElement;
@@ -147,7 +147,7 @@
RefPtr<NodeList> getElementsByTagNameNS(const AtomicString& namespaceURI, const AtomicString& localName);
RefPtr<NodeList> getElementsByName(const String& elementName);
RefPtr<HTMLCollection> getElementsByClassName(const AtomicString& classNames);
- RefPtr<NodeListBase> getElementsByClassNameForObjC(const AtomicString& classNames);
+ RefPtr<NodeList> getElementsByClassNameForObjC(const AtomicString& classNames);
RefPtr<RadioNodeList> radioNodeList(const AtomicString&);
// From the ParentNode interface - https://dom.spec.whatwg.org/#interface-parentnode
Modified: trunk/Source/WebCore/dom/NodeList.h (188752 => 188753)
--- trunk/Source/WebCore/dom/NodeList.h 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/dom/NodeList.h 2015-08-21 08:28:07 UTC (rev 188753)
@@ -24,19 +24,21 @@
#ifndef NodeList_h
#define NodeList_h
-#include "NodeListBase.h"
#include "ScriptWrappable.h"
#include <wtf/Forward.h>
+#include <wtf/RefCounted.h>
namespace WebCore {
class Node;
-class NodeList : public NodeListBase, public ScriptWrappable {
+class NodeList : public ScriptWrappable, public RefCounted<NodeList> {
public:
virtual ~NodeList() { }
// DOM methods & attributes for NodeList
+ virtual unsigned length() const = 0;
+ virtual Node* item(unsigned index) const = 0;
virtual Node* namedItem(const AtomicString&) const = 0;
// Other methods (not part of DOM)
Deleted: trunk/Source/WebCore/dom/NodeListBase.h (188752 => 188753)
--- trunk/Source/WebCore/dom/NodeListBase.h 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/dom/NodeListBase.h 2015-08-21 08:28:07 UTC (rev 188753)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#ifndef NodeListBase_h
-#define NodeListBase_h
-
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class Node;
-
-// This is a common base class for NodeList / HTMLCollection to maintain legacy ObjC API compatibility.
-class NodeListBase : public RefCounted<NodeListBase> {
-public:
- virtual ~NodeListBase() { }
-
- virtual unsigned length() const = 0;
- virtual Node* item(unsigned index) const = 0;
-};
-
-} // namespace WebCore.
-
-#endif // NodeListBase_h
-
Modified: trunk/Source/WebCore/html/HTMLCollection.h (188752 => 188753)
--- trunk/Source/WebCore/html/HTMLCollection.h 2015-08-21 04:59:59 UTC (rev 188752)
+++ trunk/Source/WebCore/html/HTMLCollection.h 2015-08-21 08:28:07 UTC (rev 188753)
@@ -58,18 +58,19 @@
#endif
};
-class HTMLCollection : public NodeListBase, public ScriptWrappable {
+// HTMLCollection subclasses NodeList to maintain legacy ObjC API compatibility.
+class HTMLCollection : public NodeList {
public:
virtual ~HTMLCollection();
// DOM API
- virtual Element* item(unsigned index) const = 0; // Tighten return type from NodeListBase::item().
- virtual Element* namedItem(const AtomicString& name) const = 0;
+ virtual Element* item(unsigned index) const override = 0; // Tighten return type from NodeList::item().
+ virtual Element* namedItem(const AtomicString& name) const override = 0; // Tighten return type from NodeList::namedItem().
PassRefPtr<NodeList> tags(const String&);
// Non-DOM API
Vector<Ref<Element>> namedItems(const AtomicString& name) const;
- virtual size_t memoryCost() const;
+ virtual size_t memoryCost() const override;
bool isRootedAtDocument() const;
NodeListInvalidationType invalidationType() const;