Diff
Modified: trunk/Source/WebCore/ChangeLog (103295 => 103296)
--- trunk/Source/WebCore/ChangeLog 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/ChangeLog 2011-12-20 03:42:22 UTC (rev 103296)
@@ -1,3 +1,40 @@
+2011-12-19 Adam Klein <ad...@chromium.org>
+
+ Remove unused ExceptionCode& argument from Element::setAttribute(QualifiedName)
+ https://bugs.webkit.org/show_bug.cgi?id=74740
+
+ Reviewed by Ryosuke Niwa.
+
+ Updated lots of callers to remove third argument. The list of changes
+ below only lists things other than updating callers.
+
+ * dom/Document.cpp:
+ (WebCore::Document::importNode):
+ * dom/Element.cpp:
+ (WebCore::Element::setAttribute):
+ (WebCore::Element::setAttributeNS):
+ (WebCore::Element::setIntegralAttribute):
+ (WebCore::Element::setUnsignedIntegralAttribute):
+ * dom/Element.h: Removed third arg from method, removed old two-arg
+ overload which now has an identical signature.
+ * editing/mac/EditorMac.mm: Updated caller and used
+ ASSERT_NO_EXCEPTION for nearby code.
+ (WebCore::styleForSelectionStart):
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::setContentEditable):
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::setAttributesAsText):
+ * svg/SVGAnimationElement.cpp:
+ (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
+ * svg/SVGElement.idl: Removed 'setter raises(DOMException)'
+ * svg/SVGGlyphRefElement.idl: ditto.
+ * svg/SVGStyleElement.cpp:
+ (WebCore::SVGStyleElement::setType):
+ (WebCore::SVGStyleElement::setMedia):
+ (WebCore::SVGStyleElement::setTitle):
+ * xml/parser/XMLTreeBuilder.cpp:
+ (WebCore::XMLTreeBuilder::processAttributes):
+
2011-12-19 Kentaro Hara <hara...@chromium.org>
Unreviewed. Rebaselined run-bindings-tests results.
Modified: trunk/Source/WebCore/dom/Document.cpp (103295 => 103296)
--- trunk/Source/WebCore/dom/Document.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/dom/Document.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -839,9 +839,7 @@
unsigned length = attrs->length();
for (unsigned i = 0; i < length; i++) {
Attribute* attr = attrs->attributeItem(i);
- newElement->setAttribute(attr->name(), attr->value().impl(), ec);
- if (ec)
- return 0;
+ newElement->setAttribute(attr->name(), attr->value().impl());
}
}
Modified: trunk/Source/WebCore/dom/Element.cpp (103295 => 103296)
--- trunk/Source/WebCore/dom/Element.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/dom/Element.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -201,12 +201,6 @@
}
}
-void Element::setAttribute(const QualifiedName& name, const AtomicString& value)
-{
- ExceptionCode ec;
- setAttribute(name, value, ec);
-}
-
void Element::setBooleanAttribute(const QualifiedName& name, bool b)
{
if (b)
@@ -641,7 +635,7 @@
setAttributeInternal(old, old ? old->name() : QualifiedName(nullAtom, localName, nullAtom), value);
}
-void Element::setAttribute(const QualifiedName& name, const AtomicString& value, ExceptionCode&)
+void Element::setAttribute(const QualifiedName& name, const AtomicString& value)
{
// Allocate attribute map if necessary.
Attribute* old = attributes(false)->getAttributeItem(name);
@@ -1502,7 +1496,7 @@
if (scriptingPermission == FragmentScriptingNotAllowed && (isEventHandlerAttribute(qName) || isAttributeToRemove(qName, value)))
return;
- setAttribute(qName, value, ec);
+ setAttribute(qName, value);
}
void Element::removeAttribute(const String& name, ExceptionCode& ec)
@@ -1894,8 +1888,7 @@
void Element::setIntegralAttribute(const QualifiedName& attributeName, int value)
{
// FIXME: Need an AtomicString version of String::number.
- ExceptionCode ec;
- setAttribute(attributeName, String::number(value), ec);
+ setAttribute(attributeName, String::number(value));
}
unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeName) const
@@ -1906,8 +1899,7 @@
void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, unsigned value)
{
// FIXME: Need an AtomicString version of String::number.
- ExceptionCode ec;
- setAttribute(attributeName, String::number(value), ec);
+ setAttribute(attributeName, String::number(value));
}
#if ENABLE(SVG)
Modified: trunk/Source/WebCore/dom/Element.h (103295 => 103296)
--- trunk/Source/WebCore/dom/Element.h 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/dom/Element.h 2011-12-20 03:42:22 UTC (rev 103296)
@@ -109,7 +109,7 @@
bool hasAttribute(const QualifiedName&) const;
const AtomicString& getAttribute(const QualifiedName&) const;
- void setAttribute(const QualifiedName&, const AtomicString& value, ExceptionCode&);
+ void setAttribute(const QualifiedName&, const AtomicString& value);
void removeAttribute(const QualifiedName&, ExceptionCode&);
// Typed getters and setters for language bindings.
@@ -209,8 +209,6 @@
void normalizeAttributes();
String nodeNamePreservingCase() const;
- // convenience methods which ignore exceptions
- void setAttribute(const QualifiedName&, const AtomicString& value);
void setBooleanAttribute(const QualifiedName& name, bool);
NamedNodeMap* attributes(bool readonly = false) const;
Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (103295 => 103296)
--- trunk/Source/WebCore/editing/mac/EditorMac.mm 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm 2011-12-20 03:42:22 UTC (rev 103296)
@@ -112,16 +112,12 @@
RefPtr<Element> styleElement = frame->document()->createElement(spanTag, false);
- ExceptionCode ec = 0;
String styleText = typingStyle->style()->cssText() + " display: inline";
- styleElement->setAttribute(styleAttr, styleText.impl(), ec);
- ASSERT(!ec);
+ styleElement->setAttribute(styleAttr, styleText.impl());
- styleElement->appendChild(frame->document()->createEditingTextNode(""), ec);
- ASSERT(!ec);
+ styleElement->appendChild(frame->document()->createEditingTextNode(""), ASSERT_NO_EXCEPTION);
- position.deprecatedNode()->parentNode()->appendChild(styleElement, ec);
- ASSERT(!ec);
+ position.deprecatedNode()->parentNode()->appendChild(styleElement, ASSERT_NO_EXCEPTION);
nodeToRemove = styleElement.get();
return styleElement->renderer() ? styleElement->renderer()->style() : 0;
Modified: trunk/Source/WebCore/html/HTMLElement.cpp (103295 => 103296)
--- trunk/Source/WebCore/html/HTMLElement.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/html/HTMLElement.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -746,9 +746,9 @@
void HTMLElement::setContentEditable(const String& enabled, ExceptionCode& ec)
{
if (equalIgnoringCase(enabled, "true"))
- setAttribute(contenteditableAttr, "true", ec);
+ setAttribute(contenteditableAttr, "true");
else if (equalIgnoringCase(enabled, "false"))
- setAttribute(contenteditableAttr, "false", ec);
+ setAttribute(contenteditableAttr, "false");
else if (equalIgnoringCase(enabled, "plaintext-only"))
setAttribute(contenteditableAttr, "plaintext-only");
else if (equalIgnoringCase(enabled, "inherit"))
Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (103295 => 103296)
--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -540,11 +540,7 @@
// Add attribute pair
const Attribute* attribute = attrMap->attributeItem(i);
foundOriginalAttribute = foundOriginalAttribute || (name && attribute->name().toString() == *name);
- element->setAttribute(attribute->name(), attribute->value(), ec);
- if (ec) {
- *errorString = "Internal error: could not set attribute value";
- return;
- }
+ element->setAttribute(attribute->name(), attribute->value());
}
if (!foundOriginalAttribute && name) {
Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (103295 => 103296)
--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -356,7 +356,7 @@
} else {
// FIXME: This should set the 'presentation' value, not the actual
// attribute value. Whatever that means in practice.
- targetElement->setAttribute(attributeName, value, ec);
+ targetElement->setAttribute(attributeName, value);
}
if (targetElement->isStyled())
@@ -372,7 +372,7 @@
if (attributeIsCSSProperty)
shadowTreeElement->style()->setProperty(attributeName.localName(), value, "", ec);
else
- shadowTreeElement->setAttribute(attributeName, value, ec);
+ shadowTreeElement->setAttribute(attributeName, value);
(*it)->correspondingUseElement()->setNeedsStyleRecalc();
}
}
@@ -630,4 +630,3 @@
}
#endif // ENABLE(SVG)
-
Modified: trunk/Source/WebCore/svg/SVGElement.idl (103295 => 103296)
--- trunk/Source/WebCore/svg/SVGElement.idl 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/svg/SVGElement.idl 2011-12-20 03:42:22 UTC (rev 103296)
@@ -26,7 +26,7 @@
GenerateNativeConverter,
Conditional=SVG
] SVGElement : Element {
- attribute [Reflect] DOMString id setter raises(DOMException);
+ attribute [Reflect] DOMString id;
attribute [ConvertNullToNullString] DOMString xmlbase setter raises(DOMException);
readonly attribute SVGSVGElement ownerSVGElement;
readonly attribute SVGElement viewportElement;
Modified: trunk/Source/WebCore/svg/SVGGlyphRefElement.idl (103295 => 103296)
--- trunk/Source/WebCore/svg/SVGGlyphRefElement.idl 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/svg/SVGGlyphRefElement.idl 2011-12-20 03:42:22 UTC (rev 103296)
@@ -25,8 +25,7 @@
// FIXME: Use [Reflect] after https://bugs.webkit.org/show_bug.cgi?id=64843 is fixed.
attribute DOMString glyphRef
setter raises(DOMException);
- attribute [Reflect] DOMString format
- setter raises(DOMException);
+ attribute [Reflect] DOMString format;
attribute float x
setter raises(DOMException);
attribute float y
Modified: trunk/Source/WebCore/svg/SVGStyleElement.cpp (103295 => 103296)
--- trunk/Source/WebCore/svg/SVGStyleElement.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/svg/SVGStyleElement.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -58,9 +58,9 @@
return n.isNull() ? defaultValue : n;
}
-void SVGStyleElement::setType(const AtomicString& type, ExceptionCode& ec)
+void SVGStyleElement::setType(const AtomicString& type, ExceptionCode&)
{
- setAttribute(SVGNames::typeAttr, type, ec);
+ setAttribute(SVGNames::typeAttr, type);
}
const AtomicString& SVGStyleElement::media() const
@@ -70,9 +70,9 @@
return n.isNull() ? defaultValue : n;
}
-void SVGStyleElement::setMedia(const AtomicString& media, ExceptionCode& ec)
+void SVGStyleElement::setMedia(const AtomicString& media, ExceptionCode&)
{
- setAttribute(SVGNames::mediaAttr, media, ec);
+ setAttribute(SVGNames::mediaAttr, media);
}
String SVGStyleElement::title() const
@@ -80,9 +80,9 @@
return fastGetAttribute(SVGNames::titleAttr);
}
-void SVGStyleElement::setTitle(const AtomicString& title, ExceptionCode& ec)
+void SVGStyleElement::setTitle(const AtomicString& title, ExceptionCode&)
{
- setAttribute(SVGNames::titleAttr, title, ec);
+ setAttribute(SVGNames::titleAttr, title);
}
bool SVGStyleElement::isSupportedAttribute(const QualifiedName& attrName)
Modified: trunk/Source/WebCore/xml/parser/XMLTreeBuilder.cpp (103295 => 103296)
--- trunk/Source/WebCore/xml/parser/XMLTreeBuilder.cpp 2011-12-20 03:36:51 UTC (rev 103295)
+++ trunk/Source/WebCore/xml/parser/XMLTreeBuilder.cpp 2011-12-20 03:42:22 UTC (rev 103296)
@@ -324,7 +324,7 @@
newElement->setAttributeNS(XMLNSNames::xmlnsNamespaceURI, xmlnsAtom, attribute->value(), ec);
else {
QualifiedName qName(attribute->prefix(), attribute->localName(), stackItem.namespaceForPrefix(attribute->prefix(), nullAtom));
- newElement->setAttribute(qName, attribute->value(), ec);
+ newElement->setAttribute(qName, attribute->value());
}
if (ec) {
m_parser->stopParsing();