Diff
Modified: trunk/Source/WebCore/ChangeLog (179769 => 179770)
--- trunk/Source/WebCore/ChangeLog 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/ChangeLog 2015-02-07 01:08:52 UTC (rev 179770)
@@ -1,3 +1,81 @@
+2015-02-06 Andreas Kling <[email protected]>
+
+ Ref-ify various getters that return HTMLCollection.
+ <https://webkit.org/b/141336>
+
+ Reviewed by Anders Carlsson.
+
+ Make all the getters that return HTMLCollection objects (and never return nullptr)
+ return Ref instead of RefPtr.
+
+ Removed a couple of useless null checks that were exposed by this change.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::getDocumentLinks):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::namedItemGetter):
+ * bindings/js/JSHTMLDocumentCustom.cpp:
+ (WebCore::JSHTMLDocument::nameGetter):
+ * dom/Document.cpp:
+ (WebCore::Document::ensureCachedCollection):
+ (WebCore::Document::images):
+ (WebCore::Document::applets):
+ (WebCore::Document::embeds):
+ (WebCore::Document::plugins):
+ (WebCore::Document::scripts):
+ (WebCore::Document::links):
+ (WebCore::Document::forms):
+ (WebCore::Document::anchors):
+ (WebCore::Document::all):
+ (WebCore::Document::windowNamedItems):
+ (WebCore::Document::documentNamedItems):
+ (WebCore::Document::iconURLs):
+ * dom/Document.h:
+ * dom/Element.cpp:
+ (WebCore::Element::ensureCachedHTMLCollection):
+ * dom/Element.h:
+ * html/ColorInputType.cpp:
+ (WebCore::ColorInputType::suggestions):
+ * html/HTMLDataListElement.cpp:
+ (WebCore::HTMLDataListElement::options):
+ * html/HTMLDataListElement.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::children):
+ * html/HTMLElement.h:
+ * html/HTMLFieldSetElement.cpp:
+ (WebCore::HTMLFieldSetElement::elements):
+ * html/HTMLFieldSetElement.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::elements):
+ * html/HTMLFormElement.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::areas):
+ * html/HTMLMapElement.h:
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::selectedOptions):
+ (WebCore::HTMLSelectElement::options):
+ * html/HTMLSelectElement.h:
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::rows):
+ (WebCore::HTMLTableElement::tBodies):
+ * html/HTMLTableElement.h:
+ * html/HTMLTableRowElement.cpp:
+ (WebCore::HTMLTableRowElement::insertCell):
+ (WebCore::HTMLTableRowElement::deleteCell):
+ (WebCore::HTMLTableRowElement::cells):
+ * html/HTMLTableRowElement.h:
+ * html/HTMLTableSectionElement.cpp:
+ (WebCore::HTMLTableSectionElement::insertRow):
+ (WebCore::HTMLTableSectionElement::deleteRow):
+ (WebCore::HTMLTableSectionElement::rows):
+ * html/HTMLTableSectionElement.h:
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::updateTickMarkValues):
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::paintSliderTicks):
+
2015-02-06 Brent Fulgham <[email protected]>
[iOS] Implement audio track selection in fullscreen.
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (179769 => 179770)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -1741,7 +1741,7 @@
void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& result)
{
Document& document = m_renderer->document();
- RefPtr<HTMLCollection> links = document.links();
+ Ref<HTMLCollection> links = document.links();
for (unsigned i = 0; Node* curr = links->item(i); i++) {
RenderObject* obj = curr->renderer();
if (obj) {
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (179769 => 179770)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -81,7 +81,7 @@
return JSValue::encode(jsUndefined());
if (UNLIKELY(downcast<HTMLDocument>(*document).windowNamedItemContainsMultipleElements(*atomicPropertyName))) {
- RefPtr<HTMLCollection> collection = document->windowNamedItems(atomicPropertyName);
+ Ref<HTMLCollection> collection = document->windowNamedItems(atomicPropertyName);
ASSERT(collection->length() > 1);
return JSValue::encode(toJS(exec, thisObj->globalObject(), WTF::getPtr(collection)));
}
Modified: trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp (179769 => 179770)
--- trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -94,7 +94,7 @@
return JSValue::encode(jsUndefined());
if (UNLIKELY(document.documentNamedItemContainsMultipleElements(*atomicPropertyName))) {
- RefPtr<HTMLCollection> collection = document.documentNamedItems(atomicPropertyName);
+ Ref<HTMLCollection> collection = document.documentNamedItems(atomicPropertyName);
ASSERT(collection->length() > 1);
return JSValue::encode(toJS(exec, thisObj->globalObject(), WTF::getPtr(collection)));
}
Modified: trunk/Source/WebCore/dom/Document.cpp (179769 => 179770)
--- trunk/Source/WebCore/dom/Document.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/dom/Document.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -4537,63 +4537,63 @@
return documentElement() && documentElement()->hasTagName(SVGNames::svgTag);
}
-RefPtr<HTMLCollection> Document::ensureCachedCollection(CollectionType type)
+Ref<HTMLCollection> Document::ensureCachedCollection(CollectionType type)
{
return ensureRareData().ensureNodeLists().addCachedCollection<HTMLCollection>(*this, type);
}
-RefPtr<HTMLCollection> Document::images()
+Ref<HTMLCollection> Document::images()
{
return ensureCachedCollection(DocImages);
}
-RefPtr<HTMLCollection> Document::applets()
+Ref<HTMLCollection> Document::applets()
{
return ensureCachedCollection(DocApplets);
}
-RefPtr<HTMLCollection> Document::embeds()
+Ref<HTMLCollection> Document::embeds()
{
return ensureCachedCollection(DocEmbeds);
}
-RefPtr<HTMLCollection> Document::plugins()
+Ref<HTMLCollection> Document::plugins()
{
// This is an alias for embeds() required for the JS DOM bindings.
return ensureCachedCollection(DocEmbeds);
}
-RefPtr<HTMLCollection> Document::scripts()
+Ref<HTMLCollection> Document::scripts()
{
return ensureCachedCollection(DocScripts);
}
-RefPtr<HTMLCollection> Document::links()
+Ref<HTMLCollection> Document::links()
{
return ensureCachedCollection(DocLinks);
}
-RefPtr<HTMLCollection> Document::forms()
+Ref<HTMLCollection> Document::forms()
{
return ensureCachedCollection(DocForms);
}
-RefPtr<HTMLCollection> Document::anchors()
+Ref<HTMLCollection> Document::anchors()
{
return ensureCachedCollection(DocAnchors);
}
-RefPtr<HTMLCollection> Document::all()
+Ref<HTMLCollection> Document::all()
{
return ensureRareData().ensureNodeLists().addCachedCollection<HTMLAllCollection>(*this, DocAll);
}
-RefPtr<HTMLCollection> Document::windowNamedItems(const AtomicString& name)
+Ref<HTMLCollection> Document::windowNamedItems(const AtomicString& name)
{
return ensureRareData().ensureNodeLists().addCachedCollection<WindowNameCollection>(*this, WindowNamedItems, name);
}
-RefPtr<HTMLCollection> Document::documentNamedItems(const AtomicString& name)
+Ref<HTMLCollection> Document::documentNamedItems(const AtomicString& name)
{
return ensureRareData().ensureNodeLists().addCachedCollection<DocumentNameCollection>(*this, DocumentNamedItems, name);
}
@@ -4704,10 +4704,10 @@
{
m_iconURLs.clear();
- if (!head() || !(head()->children()))
+ if (!head())
return m_iconURLs;
- RefPtr<HTMLCollection> children = head()->children();
+ Ref<HTMLCollection> children = head()->children();
unsigned int length = children->length();
for (unsigned int i = 0; i < length; ++i) {
Node* child = children->item(i);
Modified: trunk/Source/WebCore/dom/Document.h (179769 => 179770)
--- trunk/Source/WebCore/dom/Document.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/dom/Document.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -506,18 +506,18 @@
RefPtr<Node> adoptNode(PassRefPtr<Node> source, ExceptionCode&);
- RefPtr<HTMLCollection> images();
- RefPtr<HTMLCollection> embeds();
- RefPtr<HTMLCollection> plugins(); // an alias for embeds() required for the JS DOM bindings.
- RefPtr<HTMLCollection> applets();
- RefPtr<HTMLCollection> links();
- RefPtr<HTMLCollection> forms();
- RefPtr<HTMLCollection> anchors();
- RefPtr<HTMLCollection> scripts();
- RefPtr<HTMLCollection> all();
+ Ref<HTMLCollection> images();
+ Ref<HTMLCollection> embeds();
+ Ref<HTMLCollection> plugins(); // an alias for embeds() required for the JS DOM bindings.
+ Ref<HTMLCollection> applets();
+ Ref<HTMLCollection> links();
+ Ref<HTMLCollection> forms();
+ Ref<HTMLCollection> anchors();
+ Ref<HTMLCollection> scripts();
+ Ref<HTMLCollection> all();
- RefPtr<HTMLCollection> windowNamedItems(const AtomicString& name);
- RefPtr<HTMLCollection> documentNamedItems(const AtomicString& name);
+ Ref<HTMLCollection> windowNamedItems(const AtomicString& name);
+ Ref<HTMLCollection> documentNamedItems(const AtomicString& name);
// Other methods (not part of DOM)
bool isSynthesized() const { return m_isSynthesized; }
@@ -1351,7 +1351,7 @@
Node* nodeFromPoint(const LayoutPoint& clientPoint, LayoutPoint* localPoint = nullptr);
- RefPtr<HTMLCollection> ensureCachedCollection(CollectionType);
+ Ref<HTMLCollection> ensureCachedCollection(CollectionType);
#if ENABLE(FULLSCREEN_API)
void dispatchFullScreenChangeOrErrorEvent(Deque<RefPtr<Node>>&, const AtomicString& eventName, bool shouldNotifyMediaElement);
Modified: trunk/Source/WebCore/dom/Element.cpp (179769 => 179770)
--- trunk/Source/WebCore/dom/Element.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/dom/Element.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -2901,10 +2901,10 @@
dispatchSubtreeModifiedEvent();
}
-RefPtr<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType type)
+Ref<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType type)
{
if (HTMLCollection* collection = cachedHTMLCollection(type))
- return collection;
+ return *collection;
if (type == TableRows) {
return ensureRareData().ensureNodeLists().addCachedCollection<HTMLTableRowsCollection>(downcast<HTMLTableElement>(*this), type);
Modified: trunk/Source/WebCore/dom/Element.h (179769 => 179770)
--- trunk/Source/WebCore/dom/Element.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/dom/Element.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -570,7 +570,7 @@
void clearTabIndexExplicitlyIfNeeded();
void setTabIndexExplicitly(short);
- RefPtr<HTMLCollection> ensureCachedHTMLCollection(CollectionType);
+ Ref<HTMLCollection> ensureCachedHTMLCollection(CollectionType);
HTMLCollection* cachedHTMLCollection(CollectionType);
// classAttributeChanged() exists to share code between
Modified: trunk/Source/WebCore/html/ColorInputType.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/ColorInputType.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/ColorInputType.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -229,7 +229,7 @@
#if ENABLE(DATALIST_ELEMENT)
HTMLDataListElement* dataList = element().dataList();
if (dataList) {
- RefPtr<HTMLCollection> options = dataList->options();
+ Ref<HTMLCollection> options = dataList->options();
for (unsigned i = 0; HTMLOptionElement* option = downcast<HTMLOptionElement>(options->item(i)); ++i) {
if (!element().isValidValue(option->value()))
continue;
Modified: trunk/Source/WebCore/html/HTMLDataListElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLDataListElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLDataListElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -48,7 +48,7 @@
return adoptRef(*new HTMLDataListElement(tagName, document));
}
-RefPtr<HTMLCollection> HTMLDataListElement::options()
+Ref<HTMLCollection> HTMLDataListElement::options()
{
return ensureCachedHTMLCollection(DataListOptions);
}
Modified: trunk/Source/WebCore/html/HTMLDataListElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLDataListElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLDataListElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -42,7 +42,7 @@
public:
static Ref<HTMLDataListElement> create(const QualifiedName&, Document&);
- RefPtr<HTMLCollection> options();
+ Ref<HTMLCollection> options();
void optionElementChildrenChanged();
Modified: trunk/Source/WebCore/html/HTMLElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -806,7 +806,7 @@
setAttribute(translateAttr, enable ? "yes" : "no");
}
-RefPtr<HTMLCollection> HTMLElement::children()
+Ref<HTMLCollection> HTMLElement::children()
{
return ensureCachedHTMLCollection(NodeChildren);
}
Modified: trunk/Source/WebCore/html/HTMLElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -42,7 +42,7 @@
public:
static Ref<HTMLElement> create(const QualifiedName& tagName, Document&);
- RefPtr<HTMLCollection> children();
+ Ref<HTMLCollection> children();
WEBCORE_EXPORT virtual String title() const override final;
Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLFieldSetElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -159,7 +159,7 @@
return const_cast<HTMLLegendElement*>(childrenOfType<HTMLLegendElement>(*this).first());
}
-RefPtr<HTMLCollection> HTMLFieldSetElement::elements()
+Ref<HTMLCollection> HTMLFieldSetElement::elements()
{
return ensureCachedHTMLCollection(FormControls);
}
Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLFieldSetElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -37,7 +37,7 @@
static Ref<HTMLFieldSetElement> create(const QualifiedName&, Document&, HTMLFormElement*);
HTMLLegendElement* legend() const;
- RefPtr<HTMLCollection> elements();
+ Ref<HTMLCollection> elements();
const Vector<FormAssociatedElement*>& associatedElements() const;
unsigned length() const;
Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLFormElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -644,7 +644,7 @@
ASSERT_UNUSED(removed, removed);
}
-RefPtr<HTMLCollection> HTMLFormElement::elements()
+Ref<HTMLCollection> HTMLFormElement::elements()
{
return ensureCachedHTMLCollection(FormControls);
}
Modified: trunk/Source/WebCore/html/HTMLFormElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLFormElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLFormElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -50,7 +50,7 @@
static Ref<HTMLFormElement> create(const QualifiedName&, Document&);
virtual ~HTMLFormElement();
- RefPtr<HTMLCollection> elements();
+ Ref<HTMLCollection> elements();
bool hasNamedElement(const AtomicString&);
Vector<Ref<Element>> namedElements(const AtomicString&);
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -1887,7 +1887,7 @@
parameters.isAnchorElementRTL = computedStyle()->direction() == RTL;
#if ENABLE(DATALIST_ELEMENT)
if (HTMLDataListElement* dataList = this->dataList()) {
- RefPtr<HTMLCollection> options = dataList->options();
+ Ref<HTMLCollection> options = dataList->options();
for (unsigned i = 0; HTMLOptionElement* option = downcast<HTMLOptionElement>(options->item(i)); ++i) {
if (!isValidValue(option->value()))
continue;
Modified: trunk/Source/WebCore/html/HTMLMapElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLMapElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLMapElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -110,7 +110,7 @@
HTMLElement::parseAttribute(name, value);
}
-RefPtr<HTMLCollection> HTMLMapElement::areas()
+Ref<HTMLCollection> HTMLMapElement::areas()
{
return ensureCachedHTMLCollection(MapAreas);
}
Modified: trunk/Source/WebCore/html/HTMLMapElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLMapElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLMapElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -41,7 +41,7 @@
bool mapMouseEvent(LayoutPoint location, const LayoutSize&, HitTestResult&);
HTMLImageElement* imageElement();
- RefPtr<HTMLCollection> areas();
+ Ref<HTMLCollection> areas();
private:
HTMLMapElement(const QualifiedName&, Document&);
Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLSelectElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -373,12 +373,12 @@
return validationMessageShadowTreeContains(child);
}
-RefPtr<HTMLCollection> HTMLSelectElement::selectedOptions()
+Ref<HTMLCollection> HTMLSelectElement::selectedOptions()
{
return ensureCachedHTMLCollection(SelectedOptions);
}
-RefPtr<HTMLOptionsCollection> HTMLSelectElement::options()
+Ref<HTMLOptionsCollection> HTMLSelectElement::options()
{
return downcast<HTMLOptionsCollection>(ensureCachedHTMLCollection(SelectOptions).get());
}
Modified: trunk/Source/WebCore/html/HTMLSelectElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLSelectElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLSelectElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -67,8 +67,8 @@
WEBCORE_EXPORT String value() const;
void setValue(const String&);
- RefPtr<HTMLOptionsCollection> options();
- RefPtr<HTMLCollection> selectedOptions();
+ Ref<HTMLOptionsCollection> options();
+ Ref<HTMLCollection> selectedOptions();
void optionElementChildrenChanged();
Modified: trunk/Source/WebCore/html/HTMLTableElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLTableElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLTableElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -550,12 +550,12 @@
return attribute.name() == backgroundAttr || HTMLElement::isURLAttribute(attribute);
}
-RefPtr<HTMLCollection> HTMLTableElement::rows()
+Ref<HTMLCollection> HTMLTableElement::rows()
{
return ensureCachedHTMLCollection(TableRows);
}
-RefPtr<HTMLCollection> HTMLTableElement::tBodies()
+Ref<HTMLCollection> HTMLTableElement::tBodies()
{
return ensureCachedHTMLCollection(TableTBodies);
}
Modified: trunk/Source/WebCore/html/HTMLTableElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLTableElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLTableElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -60,8 +60,8 @@
RefPtr<HTMLElement> insertRow(int index, ExceptionCode&);
void deleteRow(int index, ExceptionCode&);
- RefPtr<HTMLCollection> rows();
- RefPtr<HTMLCollection> tBodies();
+ Ref<HTMLCollection> rows();
+ Ref<HTMLCollection> tBodies();
const AtomicString& rules() const;
const AtomicString& summary() const;
Modified: trunk/Source/WebCore/html/HTMLTableRowElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLTableRowElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLTableRowElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -120,8 +120,8 @@
RefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionCode& ec)
{
- RefPtr<HTMLCollection> children = cells();
- int numCells = children ? children->length() : 0;
+ Ref<HTMLCollection> children = cells();
+ int numCells = children->length();
if (index < -1 || index > numCells) {
ec = INDEX_SIZE_ERR;
return 0;
@@ -143,8 +143,8 @@
void HTMLTableRowElement::deleteCell(int index, ExceptionCode& ec)
{
- RefPtr<HTMLCollection> children = cells();
- int numCells = children ? children->length() : 0;
+ Ref<HTMLCollection> children = cells();
+ int numCells = children->length();
if (index == -1)
index = numCells-1;
if (index >= 0 && index < numCells) {
@@ -154,7 +154,7 @@
ec = INDEX_SIZE_ERR;
}
-RefPtr<HTMLCollection> HTMLTableRowElement::cells()
+Ref<HTMLCollection> HTMLTableRowElement::cells()
{
return ensureCachedHTMLCollection(TRCells);
}
Modified: trunk/Source/WebCore/html/HTMLTableRowElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLTableRowElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLTableRowElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -45,7 +45,7 @@
RefPtr<HTMLElement> insertCell(int index, ExceptionCode&);
void deleteCell(int index, ExceptionCode&);
- RefPtr<HTMLCollection> cells();
+ Ref<HTMLCollection> cells();
void setCells(HTMLCollection *, ExceptionCode&);
private:
Modified: trunk/Source/WebCore/html/HTMLTableSectionElement.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLTableSectionElement.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLTableSectionElement.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -59,8 +59,8 @@
RefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionCode& ec)
{
RefPtr<HTMLTableRowElement> row;
- RefPtr<HTMLCollection> children = rows();
- int numRows = children ? (int)children->length() : 0;
+ Ref<HTMLCollection> children = rows();
+ int numRows = children->length();
if (index < -1 || index > numRows)
ec = INDEX_SIZE_ERR; // per the DOM
else {
@@ -81,8 +81,8 @@
void HTMLTableSectionElement::deleteRow(int index, ExceptionCode& ec)
{
- RefPtr<HTMLCollection> children = rows();
- int numRows = children ? (int)children->length() : 0;
+ Ref<HTMLCollection> children = rows();
+ int numRows = children->length();
if (index == -1)
index = numRows - 1;
if (index >= 0 && index < numRows) {
@@ -145,7 +145,7 @@
setAttribute(valignAttr, value);
}
-RefPtr<HTMLCollection> HTMLTableSectionElement::rows()
+Ref<HTMLCollection> HTMLTableSectionElement::rows()
{
return ensureCachedHTMLCollection(TSectionRows);
}
Modified: trunk/Source/WebCore/html/HTMLTableSectionElement.h (179769 => 179770)
--- trunk/Source/WebCore/html/HTMLTableSectionElement.h 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/HTMLTableSectionElement.h 2015-02-07 01:08:52 UTC (rev 179770)
@@ -53,7 +53,7 @@
const AtomicString& vAlign() const;
void setVAlign(const AtomicString&);
- RefPtr<HTMLCollection> rows();
+ Ref<HTMLCollection> rows();
private:
HTMLTableSectionElement(const QualifiedName& tagName, Document&);
Modified: trunk/Source/WebCore/html/RangeInputType.cpp (179769 => 179770)
--- trunk/Source/WebCore/html/RangeInputType.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/html/RangeInputType.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -368,7 +368,7 @@
HTMLDataListElement* dataList = element().dataList();
if (!dataList)
return;
- RefPtr<HTMLCollection> options = dataList->options();
+ Ref<HTMLCollection> options = dataList->options();
m_tickMarkValues.reserveCapacity(options->length());
for (unsigned i = 0; i < options->length(); ++i) {
Node* node = options->item(i);
Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (179769 => 179770)
--- trunk/Source/WebCore/rendering/RenderTheme.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -1030,7 +1030,7 @@
tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.width() * zoomFactor) / 2.0;
tickRegionWidth = trackBounds.height() - thumbSize.width();
}
- RefPtr<HTMLCollection> options = dataList->options();
+ Ref<HTMLCollection> options = dataList->options();
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->setFillColor(o.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
for (unsigned i = 0; Node* node = options->item(i); i++) {
Modified: trunk/Source/WebKit/win/DOMHTMLClasses.cpp (179769 => 179770)
--- trunk/Source/WebKit/win/DOMHTMLClasses.cpp 2015-02-07 00:45:50 UTC (rev 179769)
+++ trunk/Source/WebKit/win/DOMHTMLClasses.cpp 2015-02-07 01:08:52 UTC (rev 179770)
@@ -703,9 +703,6 @@
ASSERT(m_element);
HTMLSelectElement& selectElement = downcast<HTMLSelectElement>(*m_element);
- if (!selectElement.options())
- return E_FAIL;
-
*result = nullptr;
RefPtr<HTMLOptionsCollection> options = selectElement.options();
*result = DOMHTMLOptionsCollection::createInstance(options.get());