Title: [199335] trunk/Source/WebCore
Revision
199335
Author
[email protected]
Date
2016-04-11 22:49:45 -0700 (Mon, 11 Apr 2016)

Log Message

Remove UsePointersEvenForNonNullableObjectArguments from HTMLOptionsCollection
https://bugs.webkit.org/show_bug.cgi?id=156491

Reviewed by Chris Dumez.

* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add): Take a reference instead of a pointer.
* html/HTMLOptionsCollection.h: Removed unneeded forward declaration. Changed
add to take a reference instead of a pointer for the element to add. Used
final instead of override on virtual functions.
* html/HTMLOptionsCollection.idl: Removed now-unneeded attribute
UsePointersEvenForNonNullableObjectArguments; the only function affected was
add, and the overloading code was already checking for null.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (199334 => 199335)


--- trunk/Source/WebCore/ChangeLog	2016-04-12 04:15:16 UTC (rev 199334)
+++ trunk/Source/WebCore/ChangeLog	2016-04-12 05:49:45 UTC (rev 199335)
@@ -1,5 +1,21 @@
 2016-04-11  Darin Adler  <[email protected]>
 
+        Remove UsePointersEvenForNonNullableObjectArguments from HTMLOptionsCollection
+        https://bugs.webkit.org/show_bug.cgi?id=156491
+
+        Reviewed by Chris Dumez.
+
+        * html/HTMLOptionsCollection.cpp:
+        (WebCore::HTMLOptionsCollection::add): Take a reference instead of a pointer.
+        * html/HTMLOptionsCollection.h: Removed unneeded forward declaration. Changed
+        add to take a reference instead of a pointer for the element to add. Used
+        final instead of override on virtual functions.
+        * html/HTMLOptionsCollection.idl: Removed now-unneeded attribute
+        UsePointersEvenForNonNullableObjectArguments; the only function affected was
+        add, and the overloading code was already checking for null.
+
+2016-04-11  Darin Adler  <[email protected]>
+
         Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
         https://bugs.webkit.org/show_bug.cgi?id=156458
 

Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.cpp (199334 => 199335)


--- trunk/Source/WebCore/html/HTMLOptionsCollection.cpp	2016-04-12 04:15:16 UTC (rev 199334)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.cpp	2016-04-12 05:49:45 UTC (rev 199335)
@@ -36,14 +36,12 @@
     return adoptRef(*new HTMLOptionsCollection(select));
 }
 
-void HTMLOptionsCollection::add(HTMLElement* element, HTMLElement* beforeElement, ExceptionCode& ec)
+void HTMLOptionsCollection::add(HTMLElement& element, HTMLElement* beforeElement, ExceptionCode& ec)
 {
-    if (!element)
-        return;
-    selectElement().add(*element, beforeElement, ec);
+    selectElement().add(element, beforeElement, ec);
 }
 
-void HTMLOptionsCollection::add(HTMLElement* element, int beforeIndex, ExceptionCode& ec)
+void HTMLOptionsCollection::add(HTMLElement& element, int beforeIndex, ExceptionCode& ec)
 {
     add(element, item(beforeIndex), ec);
 }

Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.h (199334 => 199335)


--- trunk/Source/WebCore/html/HTMLOptionsCollection.h	2016-04-12 04:15:16 UTC (rev 199334)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.h	2016-04-12 05:49:45 UTC (rev 199335)
@@ -30,8 +30,6 @@
 
 namespace WebCore {
 
-class HTMLOptionElement;
-
 typedef int ExceptionCode;
 
 class HTMLOptionsCollection final : public CachedHTMLCollection<HTMLOptionsCollection, CollectionTypeTraits<SelectOptions>::traversalType> {
@@ -41,11 +39,11 @@
     HTMLSelectElement& selectElement() { return downcast<HTMLSelectElement>(ownerNode()); }
     const HTMLSelectElement& selectElement() const { return downcast<HTMLSelectElement>(ownerNode()); }
 
-    HTMLOptionElement* item(unsigned offset) const override;
-    HTMLOptionElement* namedItem(const AtomicString& name) const override;
+    HTMLOptionElement* item(unsigned offset) const final;
+    HTMLOptionElement* namedItem(const AtomicString& name) const final;
 
-    void add(HTMLElement*, HTMLElement* beforeElement, ExceptionCode&);
-    void add(HTMLElement*, int beforeIndex, ExceptionCode&);
+    void add(HTMLElement&, HTMLElement* beforeElement, ExceptionCode&);
+    void add(HTMLElement&, int beforeIndex, ExceptionCode&);
     void remove(int index);
     void remove(HTMLOptionElement&);
 

Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.idl (199334 => 199335)


--- trunk/Source/WebCore/html/HTMLOptionsCollection.idl	2016-04-12 04:15:16 UTC (rev 199334)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.idl	2016-04-12 05:49:45 UTC (rev 199335)
@@ -21,7 +21,6 @@
 [
     JSGenerateToNativeObject,
     CustomIndexedSetter,
-    UsePointersEvenForNonNullableObjectArguments,
     GenerateIsReachable=ImplOwnerNodeRoot,
 ] interface HTMLOptionsCollection : HTMLCollection {
     attribute long selectedIndex;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to