Title: [195264] trunk/Source
Revision
195264
Author
[email protected]
Date
2016-01-19 00:58:49 -0800 (Tue, 19 Jan 2016)

Log Message

CharacterData::setData doesn't need ExceptionCode as an out argument
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:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (195263 => 195264)


--- trunk/Source/WebCore/ChangeLog	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/ChangeLog	2016-01-19 08:58:49 UTC (rev 195264)
@@ -1,5 +1,38 @@
 2016-01-19  Ryosuke Niwa  <[email protected]>
 
+        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  <[email protected]>
+
         innerHTML should always add a mutation record for removing all children
         https://bugs.webkit.org/show_bug.cgi?id=148782
         <rdar://problem/22571962>

Modified: trunk/Source/WebCore/dom/CharacterData.cpp (195263 => 195264)


--- trunk/Source/WebCore/dom/CharacterData.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/dom/CharacterData.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -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 @@
     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)

Modified: trunk/Source/WebCore/dom/CharacterData.h (195263 => 195264)


--- trunk/Source/WebCore/dom/CharacterData.h	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/dom/CharacterData.h	2016-01-19 08:58:49 UTC (rev 195264)
@@ -33,7 +33,7 @@
     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&);

Modified: trunk/Source/WebCore/dom/CharacterData.idl (195263 => 195264)


--- trunk/Source/WebCore/dom/CharacterData.idl	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/dom/CharacterData.idl	2016-01-19 08:58:49 UTC (rev 195264)
@@ -19,7 +19,7 @@
 
 interface CharacterData : Node {
 
-    [TreatNullAs=NullString, SetterRaisesException] attribute DOMString data;
+    [TreatNullAs=NullString] attribute DOMString data;
 
     readonly attribute unsigned long length;
     

Modified: trunk/Source/WebCore/dom/Range.cpp (195263 => 195264)


--- trunk/Source/WebCore/dom/Range.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/dom/Range.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -707,7 +707,7 @@
         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 @@
             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:

Modified: trunk/Source/WebCore/dom/Text.cpp (195263 => 195264)


--- trunk/Source/WebCore/dom/Text.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/dom/Text.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -152,7 +152,7 @@
         return nullptr;
     }
 
-    setData(newText, IGNORE_EXCEPTION);
+    setData(newText);
     return protectedThis;
 }
 

Modified: trunk/Source/WebCore/editing/markup.cpp (195263 => 195264)


--- trunk/Source/WebCore/editing/markup.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/editing/markup.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -1019,7 +1019,7 @@
     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 @@
     ChildListMutationScope mutation(containerNode);
 
     if (hasOneTextChild(containerNode)) {
-        downcast<Text>(*containerNode->firstChild()).setData(text, ec);
+        downcast<Text>(*containerNode->firstChild()).setData(text);
         return;
     }
 

Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (195263 => 195264)


--- trunk/Source/WebCore/html/HTMLOptionElement.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -119,7 +119,7 @@
     // 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);

Modified: trunk/Source/WebCore/html/HTMLScriptElement.cpp (195263 => 195264)


--- trunk/Source/WebCore/html/HTMLScriptElement.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/html/HTMLScriptElement.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -83,7 +83,7 @@
     Ref<HTMLScriptElement> protectFromMutationEvents(*this);
 
     if (hasOneChild() && is<Text>(*firstChild())) {
-        downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
+        downcast<Text>(*firstChild()).setData(value);
         return;
     }
 

Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (195263 => 195264)


--- trunk/Source/WebCore/html/HTMLTitleElement.cpp	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp	2016-01-19 08:58:49 UTC (rev 195264)
@@ -93,7 +93,7 @@
     Ref<HTMLTitleElement> protectFromMutationEvents(*this);
     
     if (!value.isEmpty() && hasOneChild() && is<Text>(*firstChild())) {
-        downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
+        downcast<Text>(*firstChild()).setData(value);
         return;
     }
 

Modified: trunk/Source/WebKit2/ChangeLog (195263 => 195264)


--- trunk/Source/WebKit2/ChangeLog	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebKit2/ChangeLog	2016-01-19 08:58:49 UTC (rev 195264)
@@ -1,3 +1,13 @@
+2016-01-19  Ryosuke Niwa  <[email protected]>
+
+        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  <[email protected]>
 
         [EFL] Remove wkView() from EwkView

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm (195263 => 195264)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm	2016-01-19 08:39:44 UTC (rev 195263)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm	2016-01-19 08:58:49 UTC (rev 195264)
@@ -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
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to