blob: 42ceeb9fa470cd624435e642d83b94c18444bfb6 [file] [log] [blame]
andersca5eadba02006-08-14 16:32:34 +00001/*
darin@apple.com4b47a4d2016-10-19 16:57:31 +00002 * Copyright (C) 2003, 2006 Apple Inc. All rights reserved.
andersca5eadba02006-08-14 16:32:34 +00003 *
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 of the License, or (at your option) any later version.
8 *
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.
13 *
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
ddkilzerc8eccec2007-09-26 02:29:57 +000016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
andersca5eadba02006-08-14 16:32:34 +000017 */
18
darin@apple.com4b47a4d2016-10-19 16:57:31 +000019#pragma once
andersca5eadba02006-08-14 16:32:34 +000020
darin@apple.com4b47a4d2016-10-19 16:57:31 +000021#include "ExceptionOr.h"
cdumez@apple.com76214762016-09-27 23:33:08 +000022#include <wtf/WeakPtr.h>
andersca5eadba02006-08-14 16:32:34 +000023
24namespace WebCore {
darin@apple.com734fbf62008-02-10 19:27:12 +000025
tonyg@chromium.orgaa1d3882010-12-30 23:41:56 +000026class Document;
27
28class DOMParser : public RefCounted<DOMParser> {
29public:
darin@apple.com4b47a4d2016-10-19 16:57:31 +000030 static Ref<DOMParser> create(Document& contextDocument);
cdumez@apple.com7ca84452019-09-20 21:35:58 +000031 ExceptionOr<Ref<Document>> parseFromString(const String&, const String& contentType);
tonyg@chromium.orgaa1d3882010-12-30 23:41:56 +000032
33private:
cdumez@apple.com76214762016-09-27 23:33:08 +000034 explicit DOMParser(Document& contextDocument);
35
36 WeakPtr<Document> m_contextDocument;
tonyg@chromium.orgaa1d3882010-12-30 23:41:56 +000037};
darin@apple.com734fbf62008-02-10 19:27:12 +000038
andersca5eadba02006-08-14 16:32:34 +000039}