2 Copyright (C) 2011 Samsung Electronics
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "WebKitDOM_Node.h"
21 #include "WebKitDOM_Node_Private.h"
24 #include <wtf/text/CString.h>
25 #include <wtf/GetPtr.h>
26 #include <wtf/RefPtr.h>
29 void ewk_webkitdom_node_insert_before(WebKitDOM_Node* self, WebKitDOM_Node* newChild, WebKitDOM_Node* refChild, WebKitDOM_Node* ret)
34 WebCore::Node* coreObj = _to_webcore_node(self);
35 WebCore::Node* newChildCore = _to_webcore_node(newChild);
36 WebCore::Node* refChildCore = _to_webcore_node(refChild);
38 WebCore::ExceptionCode ec = 0;
39 if (coreObj->insertBefore( newChildCore, refChildCore, ec))
41 _copy_webkit_node(newChild, ret);
45 _to_webkit_node(0, ret);
48 void ewk_webkitdom_node_append_child(WebKitDOM_Node* self, WebKitDOM_Node* newChild, WebKitDOM_Node* ret)
53 WebCore::Node* coreObj = _to_webcore_node(self);
54 WebCore::Node* newChildCore = _to_webcore_node(newChild);
56 WebCore::ExceptionCode ec = 0;
57 if (coreObj->appendChild(newChildCore, ec))
59 _copy_webkit_node(newChild, ret);
63 _to_webkit_node(0, ret);