https://bugs.webkit.org/show_bug.cgi?id=153225
Reviewed by Antti Koivisto.
Source/WebCore:
Removed the ExceptionCode out argument from CharacterData::setData since it's never used.
* dom/CharacterData.cpp:
(WebCore::CharacterData::setData):
(WebCore::CharacterData::containsOnlyWhitespace):
(WebCore::CharacterData::setNodeValue):
(WebCore::CharacterData::setDataAndUpdate):
* dom/CharacterData.h:
(WebCore::CharacterData::data):
(WebCore::CharacterData::dataMemoryOffset):
(WebCore::CharacterData::length):
* dom/CharacterData.idl:
* dom/Range.cpp:
(WebCore::Range::processContentsBetweenOffsets):
* dom/Text.cpp:
(WebCore::Text::replaceWholeText):
* editing/markup.cpp:
(WebCore::replaceChildrenWithFragment):
(WebCore::replaceChildrenWithText):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
Source/WebKit2:
* WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
(-[WKDOMText setData:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@195264
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2016-01-19 Ryosuke Niwa <rniwa@webkit.org>
+ CharacterData::setData doesn't need ExceptionCode as an out argument
+ https://bugs.webkit.org/show_bug.cgi?id=153225
+
+ Reviewed by Antti Koivisto.
+
+ Removed the ExceptionCode out argument from CharacterData::setData since it's never used.
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::setData):
+ (WebCore::CharacterData::containsOnlyWhitespace):
+ (WebCore::CharacterData::setNodeValue):
+ (WebCore::CharacterData::setDataAndUpdate):
+ * dom/CharacterData.h:
+ (WebCore::CharacterData::data):
+ (WebCore::CharacterData::dataMemoryOffset):
+ (WebCore::CharacterData::length):
+ * dom/CharacterData.idl:
+ * dom/Range.cpp:
+ (WebCore::Range::processContentsBetweenOffsets):
+ * dom/Text.cpp:
+ (WebCore::Text::replaceWholeText):
+ * editing/markup.cpp:
+ (WebCore::replaceChildrenWithFragment):
+ (WebCore::replaceChildrenWithText):
+ * html/HTMLOptionElement.cpp:
+ (WebCore::HTMLOptionElement::setText):
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::setText):
+ * html/HTMLTitleElement.cpp:
+ (WebCore::HTMLTitleElement::setText):
+
+2016-01-19 Ryosuke Niwa <rniwa@webkit.org>
+
innerHTML should always add a mutation record for removing all children
https://bugs.webkit.org/show_bug.cgi?id=148782
<rdar://problem/22571962>
namespace WebCore {
-void CharacterData::setData(const String& data, ExceptionCode&)
+void CharacterData::setData(const String& data)
{
const String& nonNullData = !data.isNull() ? data : emptyString();
if (m_data == nonNullData)
return m_data.containsOnlyWhitespace();
}
-void CharacterData::setNodeValue(const String& nodeValue, ExceptionCode& ec)
+void CharacterData::setNodeValue(const String& nodeValue, ExceptionCode&)
{
- setData(nodeValue, ec);
+ setData(nodeValue);
}
void CharacterData::setDataAndUpdate(const String& newData, unsigned offsetOfReplacedData, unsigned oldLength, unsigned newLength)
const String& data() const { return m_data; }
static ptrdiff_t dataMemoryOffset() { return OBJECT_OFFSETOF(CharacterData, m_data); }
- WEBCORE_EXPORT void setData(const String&, ExceptionCode&);
+ WEBCORE_EXPORT void setData(const String&);
unsigned length() const { return m_data.length(); }
String substringData(unsigned offset, unsigned count, ExceptionCode&);
void appendData(const String&);
interface CharacterData : Node {
- [TreatNullAs=NullString, SetterRaisesException] attribute DOMString data;
+ [TreatNullAs=NullString] attribute DOMString data;
readonly attribute unsigned long length;
startOffset = std::min(startOffset, endOffset);
if (action == Extract || action == Clone) {
RefPtr<ProcessingInstruction> c = static_cast<ProcessingInstruction*>(container->cloneNode(true).ptr());
- c->setData(c->data().substring(startOffset, endOffset - startOffset), ec);
+ c->setData(c->data().substring(startOffset, endOffset - startOffset));
if (fragment) {
result = fragment;
result->appendChild(c.release(), ec);
ProcessingInstruction& pi = downcast<ProcessingInstruction>(*container);
String data(pi.data());
data.remove(startOffset, endOffset - startOffset);
- pi.setData(data, ec);
+ pi.setData(data);
}
break;
case Node::ELEMENT_NODE:
return nullptr;
}
- setData(newText, IGNORE_EXCEPTION);
+ setData(newText);
return protectedThis;
}
if (containerChild && !containerChild->nextSibling()) {
if (is<Text>(*containerChild) && hasOneTextChild(fragment) && canUseSetDataOptimization(downcast<Text>(*containerChild), mutation)) {
ASSERT(!fragment->firstChild()->refCount());
- downcast<Text>(*containerChild).setData(downcast<Text>(*fragment->firstChild()).data(), ec);
+ downcast<Text>(*containerChild).setData(downcast<Text>(*fragment->firstChild()).data());
return;
}
ChildListMutationScope mutation(containerNode);
if (hasOneTextChild(containerNode)) {
- downcast<Text>(*containerNode->firstChild()).setData(text, ec);
+ downcast<Text>(*containerNode->firstChild()).setData(text);
return;
}
// Handle the common special case where there's exactly 1 child node, and it's a text node.
Node* child = firstChild();
if (is<Text>(child) && !child->nextSibling())
- downcast<Text>(*child).setData(text, ec);
+ downcast<Text>(*child).setData(text);
else {
removeChildren();
appendChild(Text::create(document(), text), ec);
Ref<HTMLScriptElement> protectFromMutationEvents(*this);
if (hasOneChild() && is<Text>(*firstChild())) {
- downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
+ downcast<Text>(*firstChild()).setData(value);
return;
}
Ref<HTMLTitleElement> protectFromMutationEvents(*this);
if (!value.isEmpty() && hasOneChild() && is<Text>(*firstChild())) {
- downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
+ downcast<Text>(*firstChild()).setData(value);
return;
}
+2016-01-19 Ryosuke Niwa <rniwa@webkit.org>
+
+ CharacterData::setData doesn't need ExceptionCode as an out argument
+ https://bugs.webkit.org/show_bug.cgi?id=153225
+
+ Reviewed by Antti Koivisto.
+
+ * WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
+ (-[WKDOMText setData:]):
+
2016-01-18 Ryuan Choi <ryuan.choi@navercorp.com>
[EFL] Remove wkView() from EwkView
- (void)setData:(NSString *)data
{
- // FIXME: Do something about the exception.
- WebCore::ExceptionCode ec;
- downcast<WebCore::Text>(*_impl).setData(data, ec);
+ downcast<WebCore::Text>(*_impl).setData(data);
}
@end