darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 1 | /* |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 2 | * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 | * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 | * (C) 2001 Dirk Mueller (mueller@kde.org) |
darin@apple.com | 7e131b6 | 2009-08-15 06:25:49 +0000 | [diff] [blame] | 5 | * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Library General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Library General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Library General Public License |
| 18 | * along with this library; see the file COPYING.LIB. If not, write to |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 19 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 | * Boston, MA 02110-1301, USA. |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 21 | * |
| 22 | */ |
| 23 | |
achristensen@apple.com | 760090a | 2016-08-22 15:51:58 +0000 | [diff] [blame] | 24 | #pragma once |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 25 | |
| 26 | #include "ContainerNode.h" |
abarth@webkit.org | 26dfd17 | 2010-06-22 23:43:59 +0000 | [diff] [blame] | 27 | #include "FragmentScriptingPermission.h" |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 28 | |
| 29 | namespace WebCore { |
| 30 | |
ddkilzer@apple.com | 9c4dacc | 2009-07-11 05:36:29 +0000 | [diff] [blame] | 31 | class DocumentFragment : public ContainerNode { |
fpizlo@apple.com | 197cd32 | 2018-03-17 06:11:00 +0000 | [diff] [blame] | 32 | WTF_MAKE_ISO_ALLOCATED(DocumentFragment); |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 33 | public: |
akling@apple.com | cf2486a | 2014-12-19 03:11:36 +0000 | [diff] [blame] | 34 | static Ref<DocumentFragment> create(Document&); |
darin@apple.com | 7e131b6 | 2009-08-15 06:25:49 +0000 | [diff] [blame] | 35 | |
ggaren@apple.com | 3a37a14 | 2013-03-19 21:51:48 +0000 | [diff] [blame] | 36 | void parseHTML(const String&, Element* contextElement, ParserContentPolicy = AllowScriptingContent); |
| 37 | bool parseXML(const String&, Element* contextElement, ParserContentPolicy = AllowScriptingContent); |
rniwa@webkit.org | 2a3b3f7 | 2011-05-14 18:10:14 +0000 | [diff] [blame] | 38 | |
darin@apple.com | 49cc03e | 2016-03-04 17:20:46 +0000 | [diff] [blame] | 39 | bool canContainRangeEndPoint() const final { return true; } |
adamk@chromium.org | 0503b9a | 2013-01-03 21:16:59 +0000 | [diff] [blame] | 40 | virtual bool isTemplateContent() const { return false; } |
abarth@webkit.org | 26dfd17 | 2010-06-22 23:43:59 +0000 | [diff] [blame] | 41 | |
weinig@apple.com | 5f29100 | 2015-05-16 18:16:26 +0000 | [diff] [blame] | 42 | // From the NonElementParentNode interface - https://dom.spec.whatwg.org/#interface-nonelementparentnode |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 43 | WEBCORE_EXPORT Element* getElementById(const AtomString&) const; |
weinig@apple.com | 5f29100 | 2015-05-16 18:16:26 +0000 | [diff] [blame] | 44 | |
tkent@chromium.org | 553b172 | 2011-04-08 06:03:31 +0000 | [diff] [blame] | 45 | protected: |
antti@apple.com | d2c1d0a | 2014-02-17 22:12:30 +0000 | [diff] [blame] | 46 | DocumentFragment(Document&, ConstructionType = CreateContainer); |
darin@apple.com | 49cc03e | 2016-03-04 17:20:46 +0000 | [diff] [blame] | 47 | String nodeName() const final; |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 48 | |
tkent@chromium.org | 553b172 | 2011-04-08 06:03:31 +0000 | [diff] [blame] | 49 | private: |
darin@apple.com | 49cc03e | 2016-03-04 17:20:46 +0000 | [diff] [blame] | 50 | NodeType nodeType() const final; |
darin@apple.com | 11ff47c | 2016-03-04 16:47:55 +0000 | [diff] [blame] | 51 | Ref<Node> cloneNodeInternal(Document&, CloningOperation) override; |
| 52 | bool childTypeAllowed(NodeType) const override; |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
cdumez@apple.com | 3e58f0f | 2014-09-30 21:32:55 +0000 | [diff] [blame] | 55 | } // namespace WebCore |
weinig@apple.com | 9b9c893 | 2013-10-14 16:52:23 +0000 | [diff] [blame] | 56 | |
cdumez@apple.com | 3e58f0f | 2014-09-30 21:32:55 +0000 | [diff] [blame] | 57 | SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::DocumentFragment) |
| 58 | static bool isType(const WebCore::Node& node) { return node.isDocumentFragment(); } |
| 59 | SPECIALIZE_TYPE_TRAITS_END() |