2 * Copyright (C) 2006, 2007 Rob Buis
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library 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.
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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #ifndef StyleElement_h
22 #define StyleElement_h
24 #include "core/css/CSSStyleSheet.h"
25 #include "wtf/text/TextPosition.h"
34 class StyleElement : public WillBeGarbageCollectedMixin {
36 StyleElement(Document*, bool createdByParser);
37 virtual ~StyleElement();
38 virtual void trace(Visitor*);
41 virtual const AtomicString& type() const = 0;
42 virtual const AtomicString& media() const = 0;
44 CSSStyleSheet* sheet() const { return m_sheet.get(); }
46 bool isLoading() const;
47 bool sheetLoaded(Document&);
48 void startLoadingDynamicSheet(Document&);
50 void processStyleSheet(Document&, Element*);
51 void removedFromDocument(Document&, Element*);
52 void removedFromDocument(Document&, Element*, ContainerNode* scopingNode, TreeScope&);
53 void clearDocumentData(Document&, Element*);
54 void childrenChanged(Element*);
55 void finishParsingChildren(Element*);
57 RefPtrWillBeMember<CSSStyleSheet> m_sheet;
60 void createSheet(Element*, const String& text = String());
61 void process(Element*);
62 void clearSheet(Element* ownerElement = 0);
64 bool m_createdByParser : 1;
66 bool m_registeredAsCandidate : 1;
67 TextPosition m_startPosition;