OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #ifndef DOMEditor_h | 31 #ifndef DOMEditor_h |
32 #define DOMEditor_h | 32 #define DOMEditor_h |
33 | 33 |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
| 39 class ContainerNode; |
39 class Element; | 40 class Element; |
40 class ExceptionState; | 41 class ExceptionState; |
41 class InspectorHistory; | 42 class InspectorHistory; |
42 class Node; | 43 class Node; |
43 class Text; | 44 class Text; |
44 | 45 |
45 typedef String ErrorString; | 46 typedef String ErrorString; |
46 | 47 |
47 class DOMEditor final : public NoBaseWillBeGarbageCollected<DOMEditor> { | 48 class DOMEditor final : public NoBaseWillBeGarbageCollected<DOMEditor> { |
48 WTF_MAKE_NONCOPYABLE(DOMEditor); | 49 WTF_MAKE_NONCOPYABLE(DOMEditor); |
49 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 50 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
50 public: | 51 public: |
51 explicit DOMEditor(InspectorHistory*); | 52 explicit DOMEditor(InspectorHistory*); |
52 | 53 |
53 void trace(Visitor*); | 54 void trace(Visitor*); |
54 | 55 |
55 bool insertBefore(Node* parentNode, PassRefPtrWillBeRawPtr<Node>, Node* anch
orNode, ExceptionState&); | 56 bool insertBefore(ContainerNode* parentNode, PassRefPtrWillBeRawPtr<Node>, N
ode* anchorNode, ExceptionState&); |
56 bool removeChild(Node* parentNode, Node*, ExceptionState&); | 57 bool removeChild(ContainerNode* parentNode, Node*, ExceptionState&); |
57 bool setAttribute(Element*, const String& name, const String& value, Excepti
onState&); | 58 bool setAttribute(Element*, const String& name, const String& value, Excepti
onState&); |
58 bool removeAttribute(Element*, const String& name, ExceptionState&); | 59 bool removeAttribute(Element*, const String& name, ExceptionState&); |
59 bool setOuterHTML(Node*, const String& html, Node** newNode, ExceptionState&
); | 60 bool setOuterHTML(Node*, const String& html, Node** newNode, ExceptionState&
); |
60 bool replaceWholeText(Text*, const String& text, ExceptionState&); | 61 bool replaceWholeText(Text*, const String& text, ExceptionState&); |
61 bool replaceChild(Node* parentNode, PassRefPtrWillBeRawPtr<Node> newNode, No
de* oldNode, ExceptionState&); | 62 bool replaceChild(ContainerNode* parentNode, PassRefPtrWillBeRawPtr<Node> ne
wNode, Node* oldNode, ExceptionState&); |
62 bool setNodeValue(Node* parentNode, const String& value, ExceptionState&); | 63 bool setNodeValue(Node* parentNode, const String& value, ExceptionState&); |
63 | 64 |
64 bool insertBefore(Node* parentNode, PassRefPtrWillBeRawPtr<Node>, Node* anch
orNode, ErrorString*); | 65 bool insertBefore(ContainerNode* parentNode, PassRefPtrWillBeRawPtr<Node>, N
ode* anchorNode, ErrorString*); |
65 bool removeChild(Node* parentNode, Node*, ErrorString*); | 66 bool removeChild(ContainerNode* parentNode, Node*, ErrorString*); |
66 bool setAttribute(Element*, const String& name, const String& value, ErrorSt
ring*); | 67 bool setAttribute(Element*, const String& name, const String& value, ErrorSt
ring*); |
67 bool removeAttribute(Element*, const String& name, ErrorString*); | 68 bool removeAttribute(Element*, const String& name, ErrorString*); |
68 bool setOuterHTML(Node*, const String& html, Node** newNode, ErrorString*); | 69 bool setOuterHTML(Node*, const String& html, Node** newNode, ErrorString*); |
69 bool replaceWholeText(Text*, const String& text, ErrorString*); | 70 bool replaceWholeText(Text*, const String& text, ErrorString*); |
70 | 71 |
71 private: | 72 private: |
72 class DOMAction; | 73 class DOMAction; |
73 class RemoveChildAction; | 74 class RemoveChildAction; |
74 class InsertBeforeAction; | 75 class InsertBeforeAction; |
75 class RemoveAttributeAction; | 76 class RemoveAttributeAction; |
76 class SetAttributeAction; | 77 class SetAttributeAction; |
77 class SetOuterHTMLAction; | 78 class SetOuterHTMLAction; |
78 class ReplaceWholeTextAction; | 79 class ReplaceWholeTextAction; |
79 class ReplaceChildNodeAction; | 80 class ReplaceChildNodeAction; |
80 class SetNodeValueAction; | 81 class SetNodeValueAction; |
81 | 82 |
82 RawPtrWillBeMember<InspectorHistory> m_history; | 83 RawPtrWillBeMember<InspectorHistory> m_history; |
83 }; | 84 }; |
84 | 85 |
85 | 86 |
86 } // namespace blink | 87 } // namespace blink |
87 | 88 |
88 #endif // !defined(DOMEditor_h) | 89 #endif // !defined(DOMEditor_h) |
OLD | NEW |