Title: [205104] trunk/Source
Revision
205104
Author
akl...@apple.com
Date
2016-08-28 09:54:43 -0700 (Sun, 28 Aug 2016)

Log Message

Clean up some .text attribute setters that don't throw.
<https://webkit.org/b/161292>

Reviewed by Darin Adler.

Source/WebCore:

Remove [SetterRaisesException] for three .text attributes
and replace them with ASSERT_NO_EXCEPTION.

These setters behave like .textContent, which can't throw as
it's always okay to replace an Element's children with a Text.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setText):
* html/HTMLAnchorElement.h:
* html/HTMLAnchorElement.idl:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
* html/HTMLOptionElement.h:
* html/HTMLOptionElement.idl:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
* html/HTMLTitleElement.h:
* html/HTMLTitleElement.idl:

Source/WebKit/mac:

* DOM/DOMHTMLTitleElement.mm:
(-[DOMHTMLTitleElement setText:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205103 => 205104)


--- trunk/Source/WebCore/ChangeLog	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/ChangeLog	2016-08-28 16:54:43 UTC (rev 205104)
@@ -1,3 +1,29 @@
+2016-08-28  Andreas Kling  <akl...@apple.com>
+
+        Clean up some .text attribute setters that don't throw.
+        <https://webkit.org/b/161292>
+
+        Reviewed by Darin Adler.
+
+        Remove [SetterRaisesException] for three .text attributes
+        and replace them with ASSERT_NO_EXCEPTION.
+
+        These setters behave like .textContent, which can't throw as
+        it's always okay to replace an Element's children with a Text.
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::setText):
+        * html/HTMLAnchorElement.h:
+        * html/HTMLAnchorElement.idl:
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::setText):
+        * html/HTMLOptionElement.h:
+        * html/HTMLOptionElement.idl:
+        * html/HTMLTitleElement.cpp:
+        (WebCore::HTMLTitleElement::setText):
+        * html/HTMLTitleElement.h:
+        * html/HTMLTitleElement.idl:
+
 2016-08-24  Dave Hyatt  <hy...@apple.com>
 
         Initial landing of CSS Parser Tokenization (and files to support that). Not used yet.

Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.cpp (205103 => 205104)


--- trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.cpp	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.cpp	2016-08-28 16:54:43 UTC (rev 205104)
@@ -142,16 +142,6 @@
     return webkit_dom_node_clone_node_with_error(self, deep, nullptr);
 }
 
-void webkit_dom_document_set_title(WebKitDOMDocument* self, const gchar* title)
-{
-    webkit_dom_document_set_title_with_error(self, title, nullptr);
-}
-
-void webkit_dom_html_title_element_set_text(WebKitDOMHTMLTitleElement* self, const gchar* text)
-{
-    webkit_dom_html_title_element_set_text_with_error(self, text, nullptr);
-}
-
 gchar* webkit_dom_document_get_default_charset(WebKitDOMDocument* self)
 {
     g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), nullptr);

Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.h (205103 => 205104)


--- trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.h	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.h	2016-08-28 16:54:43 UTC (rev 205104)
@@ -171,27 +171,8 @@
 WEBKIT_DEPRECATED_FOR(webkit_dom_node_clone_node_with_error) WebKitDOMNode*
 webkit_dom_node_clone_node(WebKitDOMNode* self, gboolean deep, GError** error);
 
-/**
- * webkit_dom_document_set_title:
- * @self: A #WebKitDOMDocument
- * @title: A #gchar
- *
- * Deprecated: 2.14: Use webkit_dom_document_set_title_with_error() instead.
- */
-WEBKIT_DEPRECATED_FOR(webkit_dom_document_set_title_with_error) void
-webkit_dom_document_set_title(WebKitDOMDocument* self, const gchar* title);
 
 /**
- * webkit_dom_html_title_element_set_text:
- * @self: A #WebKitDOMHTMLTitleElement
- * @text: A #gchar
- *
- * Deprecated: 2.14: Use webkit_dom_html_title_element_set_text_with_error() instead.
- */
-WEBKIT_DEPRECATED_FOR(webkit_dom_html_title_element_set_text_with_error) void
-webkit_dom_html_title_element_set_text(WebKitDOMHTMLTitleElement* self, const gchar* text);
-
-/**
  * webkit_dom_document_get_default_charset:
  * @self: A #WebKitDOMDocument
  *

Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.symbols (205103 => 205104)


--- trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.symbols	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.symbols	2016-08-28 16:54:43 UTC (rev 205104)
@@ -21,8 +21,6 @@
 void webkit_dom_html_base_font_element_set_face(WebKitDOMHTMLBaseFontElement*, const gchar*)
 void webkit_dom_html_base_font_element_set_size(WebKitDOMHTMLBaseFontElement*, glong)
 WebKitDOMNode* webkit_dom_node_clone_node(WebKitDOMNode*, gboolean)
-void webkit_dom_document_set_title(WebKitDOMDocument*, const gchar*)
-void webkit_dom_html_title_element_set_text(WebKitDOMHTMLTitleElement*, const gchar*)
 gchar* webkit_dom_document_get_default_charset(WebKitDOMDocument*)
 WebKitDOMText* webkit_dom_text_replace_whole_text(WebKitDOMText*, const gchar*, GError**)
 gboolean webkit_dom_html_input_element_get_capture(WebKitDOMHTMLInputElement*)

Modified: trunk/Source/WebCore/bindings/gobject/webkitdom.symbols (205103 => 205104)


--- trunk/Source/WebCore/bindings/gobject/webkitdom.symbols	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/bindings/gobject/webkitdom.symbols	2016-08-28 16:54:43 UTC (rev 205104)
@@ -37,7 +37,6 @@
 WebKitDOMHTMLCollection* webkit_dom_document_get_images(WebKitDOMDocument*)
 gchar* webkit_dom_document_get_title(WebKitDOMDocument*)
 void webkit_dom_document_set_title(WebKitDOMDocument*, const gchar*)
-void webkit_dom_document_set_title_with_error(WebKitDOMDocument*, const gchar*, GError**)@2.14
 gchar* webkit_dom_document_get_charset(WebKitDOMDocument*)
 void webkit_dom_document_set_charset(WebKitDOMDocument*, const gchar*)
 gchar* webkit_dom_document_get_default_charset(WebKitDOMDocument*)
@@ -964,7 +963,6 @@
 GType webkit_dom_html_title_element_get_type(void)
 gchar* webkit_dom_html_title_element_get_text(WebKitDOMHTMLTitleElement*)
 void webkit_dom_html_title_element_set_text(WebKitDOMHTMLTitleElement*, const gchar*)
-void webkit_dom_html_title_element_set_text_with_error(WebKitDOMHTMLTitleElement*, const gchar*, GError**)@2.14
 GType webkit_dom_html_u_list_element_get_type(void)
 gchar* webkit_dom_html_u_list_element_get_type_attr(WebKitDOMHTMLUListElement*)
 void webkit_dom_html_u_list_element_set_type_attr(WebKitDOMHTMLUListElement*, const gchar*)

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (205103 => 205104)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2016-08-28 16:54:43 UTC (rev 205104)
@@ -1057,9 +1057,7 @@
 sub FunctionUsedToNotRaiseException {
     my $functionName = shift;
 
-    return $functionName eq "webkit_dom_document_set_title"
-        || $functionName eq "webkit_dom_html_title_element_set_text"
-        || $functionName eq "webkit_dom_node_clone_node";
+    return $functionName eq "webkit_dom_node_clone_node";
 }
 
 sub GenerateFunction {

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp	2016-08-28 16:54:43 UTC (rev 205104)
@@ -332,9 +332,9 @@
     return textContent();
 }
 
-void HTMLAnchorElement::setText(const String& text, ExceptionCode& ec)
+void HTMLAnchorElement::setText(const String& text)
 {
-    setTextContent(text, ec);
+    setTextContent(text, ASSERT_NO_EXCEPTION);
 }
 
 bool HTMLAnchorElement::isLiveLink() const

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLAnchorElement.h	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h	2016-08-28 16:54:43 UTC (rev 205104)
@@ -70,7 +70,7 @@
     WEBCORE_EXPORT String origin() const;
 
     WEBCORE_EXPORT String text();
-    void setText(const String&, ExceptionCode&);
+    void setText(const String&);
 
     bool isLiveLink() const;
 

Modified: trunk/Source/WebCore/html/HTMLAnchorElement.idl (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLAnchorElement.idl	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.idl	2016-08-28 16:54:43 UTC (rev 205104)
@@ -34,7 +34,7 @@
     [Reflect] attribute DOMString target;
     [Reflect] attribute DOMString type;
 
-    [SetterRaisesException] attribute DOMString text;
+    attribute DOMString text;
 
     [PutForwards=value] readonly attribute DOMTokenList relList;
 };

Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLOptionElement.cpp	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp	2016-08-28 16:54:43 UTC (rev 205104)
@@ -110,7 +110,7 @@
     return document().displayStringModifiedByEncoding(text).stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
 }
 
-void HTMLOptionElement::setText(const String &text, ExceptionCode& ec)
+void HTMLOptionElement::setText(const String &text)
 {
     Ref<HTMLOptionElement> protectedThis(*this);
 
@@ -127,7 +127,7 @@
         downcast<Text>(*child).setData(text);
     else {
         removeChildren();
-        appendChild(Text::create(document(), text), ec);
+        appendChild(Text::create(document(), text), ASSERT_NO_EXCEPTION);
     }
     
     if (selectIsMenuList && select->selectedIndex() != oldSelectedIndex)

Modified: trunk/Source/WebCore/html/HTMLOptionElement.h (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLOptionElement.h	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLOptionElement.h	2016-08-28 16:54:43 UTC (rev 205104)
@@ -39,7 +39,7 @@
        bool defaultSelected, bool selected, ExceptionCode&);
 
     WEBCORE_EXPORT String text() const;
-    void setText(const String&, ExceptionCode&);
+    void setText(const String&);
 
     WEBCORE_EXPORT int index() const;
 

Modified: trunk/Source/WebCore/html/HTMLOptionElement.idl (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLOptionElement.idl	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLOptionElement.idl	2016-08-28 16:54:43 UTC (rev 205104)
@@ -31,7 +31,7 @@
     attribute DOMString value;
 
 #if !(defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT)
-    [SetterRaisesException] attribute DOMString text;
+    attribute DOMString text;
 #else
     readonly attribute DOMString text;
 #endif

Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLTitleElement.cpp	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp	2016-08-28 16:54:43 UTC (rev 205104)
@@ -92,9 +92,9 @@
     return StringWithDirection(text(), direction);
 }
 
-void HTMLTitleElement::setText(const String& value, ExceptionCode& ec)
+void HTMLTitleElement::setText(const String& value)
 {
-    setTextContent(value, ec);
+    setTextContent(value, ASSERT_NO_EXCEPTION);
 }
 
 }

Modified: trunk/Source/WebCore/html/HTMLTitleElement.h (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLTitleElement.h	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLTitleElement.h	2016-08-28 16:54:43 UTC (rev 205104)
@@ -32,7 +32,7 @@
     static Ref<HTMLTitleElement> create(const QualifiedName&, Document&);
 
     WEBCORE_EXPORT String text() const;
-    WEBCORE_EXPORT void setText(const String&, ExceptionCode&);
+    WEBCORE_EXPORT void setText(const String&);
 
     const StringWithDirection& textWithDirection() const { return m_title; }
 

Modified: trunk/Source/WebCore/html/HTMLTitleElement.idl (205103 => 205104)


--- trunk/Source/WebCore/html/HTMLTitleElement.idl	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebCore/html/HTMLTitleElement.idl	2016-08-28 16:54:43 UTC (rev 205104)
@@ -18,6 +18,6 @@
  */
 
 interface HTMLTitleElement : HTMLElement {
-    [SetterRaisesException] attribute DOMString text;
+    attribute DOMString text;
 };
 

Modified: trunk/Source/WebKit/mac/ChangeLog (205103 => 205104)


--- trunk/Source/WebKit/mac/ChangeLog	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-08-28 16:54:43 UTC (rev 205104)
@@ -1,3 +1,13 @@
+2016-08-28  Andreas Kling  <akl...@apple.com>
+
+        Clean up some .text attribute setters that don't throw.
+        <https://webkit.org/b/161292>
+
+        Reviewed by Darin Adler.
+
+        * DOM/DOMHTMLTitleElement.mm:
+        (-[DOMHTMLTitleElement setText:]):
+
 2016-08-26  Sam Weinig  <s...@webkit.org>
 
         Remove support for ENABLE_LEGACY_WEB_AUDIO

Modified: trunk/Source/WebKit/mac/DOM/DOMHTMLTitleElement.mm (205103 => 205104)


--- trunk/Source/WebKit/mac/DOM/DOMHTMLTitleElement.mm	2016-08-28 15:46:11 UTC (rev 205103)
+++ trunk/Source/WebKit/mac/DOM/DOMHTMLTitleElement.mm	2016-08-28 16:54:43 UTC (rev 205104)
@@ -47,9 +47,7 @@
 - (void)setText:(NSString *)newText
 {
     WebCore::JSMainThreadNullState state;
-    WebCore::ExceptionCode ec = 0;
-    IMPL->setText(newText, ec);
-    raiseOnDOMError(ec);
+    IMPL->setText(newText);
 }
 
 @end
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to