| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Rob Buis | 2 * Copyright (C) 2006, 2007 Rob Buis |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class Document; | 30 class Document; |
| 31 class Element; | 31 class Element; |
| 32 | 32 |
| 33 class StyleElement : public WillBeGarbageCollectedMixin { | 33 class StyleElement : public WillBeGarbageCollectedMixin { |
| 34 public: | 34 public: |
| 35 StyleElement(Document*, bool createdByParser); | 35 StyleElement(Document*, bool createdByParser); |
| 36 virtual ~StyleElement(); | 36 virtual ~StyleElement(); |
| 37 DECLARE_VIRTUAL_TRACE(); | 37 DECLARE_VIRTUAL_TRACE(); |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 enum ProcessingResult { |
| 41 ProcessingSuccessful, |
| 42 ProcessingFatalError |
| 43 }; |
| 44 |
| 40 virtual const AtomicString& type() const = 0; | 45 virtual const AtomicString& type() const = 0; |
| 41 virtual const AtomicString& media() const = 0; | 46 virtual const AtomicString& media() const = 0; |
| 42 | 47 |
| 43 CSSStyleSheet* sheet() const { return m_sheet.get(); } | 48 CSSStyleSheet* sheet() const { return m_sheet.get(); } |
| 44 | 49 |
| 45 bool isLoading() const; | 50 bool isLoading() const; |
| 46 bool sheetLoaded(Document&); | 51 bool sheetLoaded(Document&); |
| 47 void startLoadingDynamicSheet(Document&); | 52 void startLoadingDynamicSheet(Document&); |
| 48 | 53 |
| 49 void insertedInto(Element*, ContainerNode* insertionPoint); | 54 void insertedInto(Element*, ContainerNode* insertionPoint); |
| 50 void removedFrom(Element*, ContainerNode* insertionPoint); | 55 void removedFrom(Element*, ContainerNode* insertionPoint); |
| 51 void processStyleSheet(Document&, Element*); | |
| 52 void clearDocumentData(Document&, Element*); | 56 void clearDocumentData(Document&, Element*); |
| 53 void childrenChanged(Element*); | 57 ProcessingResult processStyleSheet(Document&, Element*); |
| 54 void finishParsingChildren(Element*); | 58 ProcessingResult childrenChanged(Element*); |
| 59 ProcessingResult finishParsingChildren(Element*); |
| 55 | 60 |
| 56 RefPtrWillBeMember<CSSStyleSheet> m_sheet; | 61 RefPtrWillBeMember<CSSStyleSheet> m_sheet; |
| 57 | 62 |
| 58 private: | 63 private: |
| 59 void createSheet(Element*, const String& text = String()); | 64 ProcessingResult createSheet(Element*, const String& text = String()); |
| 60 void process(Element*); | 65 ProcessingResult process(Element*); |
| 61 void clearSheet(Element* ownerElement = 0); | 66 void clearSheet(Element* ownerElement = 0); |
| 62 | 67 |
| 63 bool m_createdByParser : 1; | 68 bool m_createdByParser : 1; |
| 64 bool m_loading : 1; | 69 bool m_loading : 1; |
| 65 bool m_registeredAsCandidate : 1; | 70 bool m_registeredAsCandidate : 1; |
| 66 TextPosition m_startPosition; | 71 TextPosition m_startPosition; |
| 67 }; | 72 }; |
| 68 | 73 |
| 69 } | 74 } |
| 70 | 75 |
| 71 #endif | 76 #endif |
| OLD | NEW |