OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class HTMLViewSourceDocument : public HTMLDocument { | 36 class HTMLViewSourceDocument : public HTMLDocument { |
37 public: | 37 public: |
38 static PassRefPtr<HTMLViewSourceDocument> create(Frame* frame, const KURL& u
rl, const String& mimeType) | 38 static PassRefPtr<HTMLViewSourceDocument> create(Frame* frame, const KURL& u
rl, const String& mimeType) |
39 { | 39 { |
40 return adoptRef(new HTMLViewSourceDocument(frame, url, mimeType)); | 40 return adoptRef(new HTMLViewSourceDocument(frame, url, mimeType)); |
41 } | 41 } |
42 | 42 |
43 void addSource(const String&, HTMLToken&); | 43 void addSource(const String&, HTMLToken&); |
44 | 44 |
| 45 virtual void acceptHeapVisitor(Visitor*) const OVERRIDE; |
| 46 |
45 private: | 47 private: |
46 HTMLViewSourceDocument(Frame*, const KURL&, const String& mimeType); | 48 HTMLViewSourceDocument(Frame*, const KURL&, const String& mimeType); |
47 | 49 |
48 // Returns HTMLViewSourceParser or TextDocumentParser based on m_type. | 50 // Returns HTMLViewSourceParser or TextDocumentParser based on m_type. |
49 virtual PassRefPtr<DocumentParser> createParser(); | 51 virtual PassRefPtr<DocumentParser> createParser(); |
50 | 52 |
51 void processDoctypeToken(const String& source, HTMLToken&); | 53 void processDoctypeToken(const String& source, HTMLToken&); |
52 void processTagToken(const String& source, HTMLToken&); | 54 void processTagToken(const String& source, HTMLToken&); |
53 void processCommentToken(const String& source, HTMLToken&); | 55 void processCommentToken(const String& source, HTMLToken&); |
54 void processCharacterToken(const String& source, HTMLToken&); | 56 void processCharacterToken(const String& source, HTMLToken&); |
55 | 57 |
56 void createContainingTable(); | 58 void createContainingTable(); |
57 PassRefPtr<Element> addSpanWithClassName(const AtomicString&); | 59 PassRefPtr<Element> addSpanWithClassName(const AtomicString&); |
58 void addLine(const AtomicString& className); | 60 void addLine(const AtomicString& className); |
59 void finishLine(); | 61 void finishLine(); |
60 void addText(const String& text, const AtomicString& className); | 62 void addText(const String& text, const AtomicString& className); |
61 int addRange(const String& source, int start, int end, const String& classNa
me, bool isLink = false, bool isAnchor = false, const String& link = String()); | 63 int addRange(const String& source, int start, int end, const String& classNa
me, bool isLink = false, bool isAnchor = false, const String& link = String()); |
62 PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor); | 64 PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor); |
63 PassRefPtr<Element> addBase(const AtomicString& href); | 65 PassRefPtr<Element> addBase(const AtomicString& href); |
64 | 66 |
65 String m_type; | 67 String m_type; |
66 RefPtr<Element> m_current; | 68 RefPtr<Element> m_current; |
67 Persistent<HTMLTableSectionElement> m_tbody; | 69 Persistent<HTMLTableSectionElement> m_tbody; |
68 Persistent<HTMLTableCellElement> m_td; | 70 Persistent<HTMLTableCellElement> m_td; |
69 }; | 71 }; |
70 | 72 |
71 } | 73 } |
72 | 74 |
73 #endif // HTMLViewSourceDocument_h | 75 #endif // HTMLViewSourceDocument_h |
OLD | NEW |