summaryrefslogtreecommitdiff
path: root/Source/WebCore/inspector/DOMEditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/inspector/DOMEditor.h')
-rw-r--r--Source/WebCore/inspector/DOMEditor.h53
1 files changed, 22 insertions, 31 deletions
diff --git a/Source/WebCore/inspector/DOMEditor.h b/Source/WebCore/inspector/DOMEditor.h
index 8cc441f18..e95a93687 100644
--- a/Source/WebCore/inspector/DOMEditor.h
+++ b/Source/WebCore/inspector/DOMEditor.h
@@ -28,12 +28,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DOMEditor_h
-#define DOMEditor_h
+#pragma once
-#include "ExceptionCode.h"
-
-#include <wtf/text/WTFString.h>
+#include "ExceptionOr.h"
namespace WebCore {
@@ -42,48 +39,42 @@ class InspectorHistory;
class Node;
class Text;
-#if ENABLE(INSPECTOR)
-
typedef String ErrorString;
class DOMEditor {
WTF_MAKE_NONCOPYABLE(DOMEditor); WTF_MAKE_FAST_ALLOCATED;
public:
- explicit DOMEditor(InspectorHistory*);
+ explicit DOMEditor(InspectorHistory&);
~DOMEditor();
- bool insertBefore(Node* parentNode, PassRefPtr<Node>, Node* anchorNode, ExceptionCode&);
- bool removeChild(Node* parentNode, Node*, ExceptionCode&);
- bool setAttribute(Element*, const String& name, const String& value, ExceptionCode&);
- bool removeAttribute(Element*, const String& name, ExceptionCode&);
- bool setOuterHTML(Node&, const String& html, Node** newNode, ExceptionCode&);
- bool replaceWholeText(Text*, const String& text, ExceptionCode&);
- bool replaceChild(Node* parentNode, PassRefPtr<Node> newNode, Node* oldNode, ExceptionCode&);
- bool setNodeValue(Node* parentNode, const String& value, ExceptionCode&);
+ ExceptionOr<void> insertBefore(Node& parentNode, Ref<Node>&&, Node* anchorNode);
+ ExceptionOr<void> removeChild(Node& parentNode, Node&);
+ ExceptionOr<void> setAttribute(Element&, const String& name, const String& value);
+ ExceptionOr<void> removeAttribute(Element&, const String& name);
+ ExceptionOr<void> setOuterHTML(Node&, const String& html, Node*& newNode);
+ ExceptionOr<void> replaceWholeText(Text&, const String& text);
+ ExceptionOr<void> replaceChild(Node& parentNode, Ref<Node>&& newNode, Node& oldNode);
+ ExceptionOr<void> setNodeValue(Node& parentNode, const String& value);
- bool insertBefore(Node* parentNode, PassRefPtr<Node>, Node* anchorNode, ErrorString*);
- bool removeChild(Node* parentNode, Node*, ErrorString*);
- bool setAttribute(Element*, const String& name, const String& value, ErrorString*);
- bool removeAttribute(Element*, const String& name, ErrorString*);
- bool setOuterHTML(Node&, const String& html, Node** newNode, ErrorString*);
- bool replaceWholeText(Text*, const String& text, ErrorString*);
+ bool insertBefore(Node& parentNode, Ref<Node>&&, Node* anchorNode, ErrorString&);
+ bool removeChild(Node& parentNode, Node&, ErrorString&);
+ bool setAttribute(Element&, const String& name, const String& value, ErrorString&);
+ bool removeAttribute(Element&, const String& name, ErrorString&);
+ bool setOuterHTML(Node&, const String& html, Node*& newNode, ErrorString&);
+ bool replaceWholeText(Text&, const String& text, ErrorString&);
private:
class DOMAction;
- class RemoveChildAction;
class InsertBeforeAction;
class RemoveAttributeAction;
- class SetAttributeAction;
- class SetOuterHTMLAction;
- class ReplaceWholeTextAction;
+ class RemoveChildAction;
class ReplaceChildNodeAction;
+ class ReplaceWholeTextAction;
+ class SetAttributeAction;
class SetNodeValueAction;
+ class SetOuterHTMLAction;
- InspectorHistory* m_history;
+ InspectorHistory& m_history;
};
-#endif // ENABLE(INSPECTOR)
-
} // namespace WebCore
-
-#endif // !defined(DOMEditor_h)