CharacterData::setData doesn't need ExceptionCode as an out argument
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jan 2016 08:58:49 +0000 (08:58 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jan 2016 08:58:49 +0000 (08:58 +0000)
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

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/CharacterData.h
Source/WebCore/dom/CharacterData.idl
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/Text.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLScriptElement.cpp
Source/WebCore/html/HTMLTitleElement.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm

index 0607db8..1841089 100644 (file)
@@ -1,5 +1,38 @@
 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>
index 0241027..76933ff 100644 (file)
@@ -38,7 +38,7 @@
 
 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)
@@ -177,9 +177,9 @@ bool CharacterData::containsOnlyWhitespace() const
     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)
index 62e1f9b..16c3de0 100644 (file)
@@ -33,7 +33,7 @@ public:
     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&);
index 99ab7d1..96451f0 100644 (file)
@@ -19,7 +19,7 @@
 
 interface CharacterData : Node {
 
-    [TreatNullAs=NullString, SetterRaisesException] attribute DOMString data;
+    [TreatNullAs=NullString] attribute DOMString data;
 
     readonly attribute unsigned long length;
     
index 60ef852..73fb1d2 100644 (file)
@@ -707,7 +707,7 @@ RefPtr<Node> Range::processContentsBetweenOffsets(ActionType action, PassRefPtr<
         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);
@@ -718,7 +718,7 @@ RefPtr<Node> Range::processContentsBetweenOffsets(ActionType action, PassRefPtr<
             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:
index 5853129..1ce654e 100644 (file)
@@ -152,7 +152,7 @@ RefPtr<Text> Text::replaceWholeText(const String& newText, ExceptionCode&)
         return nullptr;
     }
 
-    setData(newText, IGNORE_EXCEPTION);
+    setData(newText);
     return protectedThis;
 }
 
index 988b99a..302b44c 100644 (file)
@@ -1019,7 +1019,7 @@ void replaceChildrenWithFragment(ContainerNode& container, Ref<DocumentFragment>
     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;
         }
 
@@ -1037,7 +1037,7 @@ void replaceChildrenWithText(ContainerNode& container, const String& text, Excep
     ChildListMutationScope mutation(containerNode);
 
     if (hasOneTextChild(containerNode)) {
-        downcast<Text>(*containerNode->firstChild()).setData(text, ec);
+        downcast<Text>(*containerNode->firstChild()).setData(text);
         return;
     }
 
index fe8225a..baa49d2 100644 (file)
@@ -119,7 +119,7 @@ void HTMLOptionElement::setText(const String &text, ExceptionCode& ec)
     // 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);
index e13a5cd..0ea55f5 100644 (file)
@@ -83,7 +83,7 @@ void HTMLScriptElement::setText(const String &value)
     Ref<HTMLScriptElement> protectFromMutationEvents(*this);
 
     if (hasOneChild() && is<Text>(*firstChild())) {
-        downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
+        downcast<Text>(*firstChild()).setData(value);
         return;
     }
 
index 0e49e11..51342ed 100644 (file)
@@ -93,7 +93,7 @@ void HTMLTitleElement::setText(const String& value)
     Ref<HTMLTitleElement> protectFromMutationEvents(*this);
     
     if (!value.isEmpty() && hasOneChild() && is<Text>(*firstChild())) {
-        downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
+        downcast<Text>(*firstChild()).setData(value);
         return;
     }
 
index 839ce41..5a65e96 100644 (file)
@@ -1,3 +1,13 @@
+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
index e30ae3c..1746bb6 100644 (file)
@@ -40,9 +40,7 @@
 
 - (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