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 17 matching lines...) Expand all Loading... |
28 #include "core/html/HTMLDocument.h" | 28 #include "core/html/HTMLDocument.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 class HTMLTableCellElement; | 32 class HTMLTableCellElement; |
33 class HTMLTableSectionElement; | 33 class HTMLTableSectionElement; |
34 class HTMLToken; | 34 class HTMLToken; |
35 | 35 |
36 class HTMLViewSourceDocument FINAL : public HTMLDocument { | 36 class HTMLViewSourceDocument FINAL : 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(const DocumentInit& initial
izer, const String& mimeType) |
39 { | 39 { |
40 return adoptRef(new HTMLViewSourceDocument(frame, url, mimeType)); | 40 return adoptRef(new HTMLViewSourceDocument(initializer, mimeType)); |
41 } | 41 } |
42 | 42 |
43 void addSource(const String&, HTMLToken&); | 43 void addSource(const String&, HTMLToken&); |
44 | 44 |
45 private: | 45 private: |
46 HTMLViewSourceDocument(Frame*, const KURL&, const String& mimeType); | 46 HTMLViewSourceDocument(const DocumentInit&, const String& mimeType); |
47 | 47 |
48 virtual PassRefPtr<DocumentParser> createParser() OVERRIDE; | 48 virtual PassRefPtr<DocumentParser> createParser() OVERRIDE; |
49 | 49 |
50 void processDoctypeToken(const String& source, HTMLToken&); | 50 void processDoctypeToken(const String& source, HTMLToken&); |
51 void processTagToken(const String& source, HTMLToken&); | 51 void processTagToken(const String& source, HTMLToken&); |
52 void processCommentToken(const String& source, HTMLToken&); | 52 void processCommentToken(const String& source, HTMLToken&); |
53 void processCharacterToken(const String& source, HTMLToken&); | 53 void processCharacterToken(const String& source, HTMLToken&); |
54 | 54 |
55 void createContainingTable(); | 55 void createContainingTable(); |
56 PassRefPtr<Element> addSpanWithClassName(const AtomicString&); | 56 PassRefPtr<Element> addSpanWithClassName(const AtomicString&); |
57 void addLine(const AtomicString& className); | 57 void addLine(const AtomicString& className); |
58 void finishLine(); | 58 void finishLine(); |
59 void addText(const String& text, const AtomicString& className); | 59 void addText(const String& text, const AtomicString& className); |
60 int addRange(const String& source, int start, int end, const String& classNa
me, bool isLink = false, bool isAnchor = false, const String& link = String()); | 60 int addRange(const String& source, int start, int end, const String& classNa
me, bool isLink = false, bool isAnchor = false, const String& link = String()); |
61 PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor); | 61 PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor); |
62 PassRefPtr<Element> addBase(const AtomicString& href); | 62 PassRefPtr<Element> addBase(const AtomicString& href); |
63 | 63 |
64 String m_type; | 64 String m_type; |
65 RefPtr<Element> m_current; | 65 RefPtr<Element> m_current; |
66 RefPtr<HTMLTableSectionElement> m_tbody; | 66 RefPtr<HTMLTableSectionElement> m_tbody; |
67 RefPtr<HTMLTableCellElement> m_td; | 67 RefPtr<HTMLTableCellElement> m_td; |
68 }; | 68 }; |
69 | 69 |
70 } | 70 } |
71 | 71 |
72 #endif // HTMLViewSourceDocument_h | 72 #endif // HTMLViewSourceDocument_h |
OLD | NEW |