| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2  * Copyright (C) 2006, 2008, 2009, 2010 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 58 | 58 | 
| 59 PassRefPtr<DocumentParser> HTMLViewSourceDocument::createParser() | 59 PassRefPtr<DocumentParser> HTMLViewSourceDocument::createParser() | 
| 60 { | 60 { | 
| 61     return HTMLViewSourceParser::create(this, m_type); | 61     return HTMLViewSourceParser::create(this, m_type); | 
| 62 } | 62 } | 
| 63 | 63 | 
| 64 void HTMLViewSourceDocument::createContainingTable() | 64 void HTMLViewSourceDocument::createContainingTable() | 
| 65 { | 65 { | 
| 66     RefPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*this); | 66     RefPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*this); | 
| 67     parserAppendChild(html); | 67     parserAppendChild(html); | 
| 68     html->lazyAttach(); | 68     html->scheduleRenderTreeCreation(); | 
| 69     RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*this); | 69     RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*this); | 
| 70     html->parserAppendChild(body); | 70     html->parserAppendChild(body); | 
| 71 | 71 | 
| 72     // Create a line gutter div that can be used to make sure the gutter extends
      down the height of the whole | 72     // Create a line gutter div that can be used to make sure the gutter extends
      down the height of the whole | 
| 73     // document. | 73     // document. | 
| 74     RefPtr<HTMLDivElement> div = HTMLDivElement::create(*this); | 74     RefPtr<HTMLDivElement> div = HTMLDivElement::create(*this); | 
| 75     div->setAttribute(classAttr, "webkit-line-gutter-backdrop"); | 75     div->setAttribute(classAttr, "webkit-line-gutter-backdrop"); | 
| 76     body->parserAppendChild(div); | 76     body->parserAppendChild(div); | 
| 77 | 77 | 
| 78     RefPtr<HTMLTableElement> table = HTMLTableElement::create(*this); | 78     RefPtr<HTMLTableElement> table = HTMLTableElement::create(*this); | 
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 193 | 193 | 
| 194     // Create a second cell for the line contents | 194     // Create a second cell for the line contents | 
| 195     td = HTMLTableCellElement::create(tdTag, *this); | 195     td = HTMLTableCellElement::create(tdTag, *this); | 
| 196     td->setAttribute(classAttr, "webkit-line-content"); | 196     td->setAttribute(classAttr, "webkit-line-content"); | 
| 197     trow->parserAppendChild(td); | 197     trow->parserAppendChild(td); | 
| 198     m_current = m_td = td; | 198     m_current = m_td = td; | 
| 199 | 199 | 
| 200 #ifdef DEBUG_LINE_NUMBERS | 200 #ifdef DEBUG_LINE_NUMBERS | 
| 201     RefPtr<Text> lineNumberText = Text::create(*this, String::number(parser()->l
     ineNumber() + 1) + " "); | 201     RefPtr<Text> lineNumberText = Text::create(*this, String::number(parser()->l
     ineNumber() + 1) + " "); | 
| 202     td->addChild(lineNumberText); | 202     td->addChild(lineNumberText); | 
| 203     lineNumberText->lazyAttach(); | 203     lineNumberText->scheduleRenderTreeCreation(); | 
| 204 #endif | 204 #endif | 
| 205 | 205 | 
| 206     // Open up the needed spans. | 206     // Open up the needed spans. | 
| 207     if (!className.isEmpty()) { | 207     if (!className.isEmpty()) { | 
| 208         if (className == "webkit-html-attribute-name" || className == "webkit-ht
     ml-attribute-value") | 208         if (className == "webkit-html-attribute-name" || className == "webkit-ht
     ml-attribute-value") | 
| 209             m_current = addSpanWithClassName("webkit-html-tag"); | 209             m_current = addSpanWithClassName("webkit-html-tag"); | 
| 210         m_current = addSpanWithClassName(className); | 210         m_current = addSpanWithClassName(className); | 
| 211     } | 211     } | 
| 212 } | 212 } | 
| 213 | 213 | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 286     else | 286     else | 
| 287         classValue = "webkit-html-attribute-value webkit-html-resource-link"; | 287         classValue = "webkit-html-attribute-value webkit-html-resource-link"; | 
| 288     anchor->setAttribute(classAttr, classValue); | 288     anchor->setAttribute(classAttr, classValue); | 
| 289     anchor->setAttribute(targetAttr, "_blank"); | 289     anchor->setAttribute(targetAttr, "_blank"); | 
| 290     anchor->setAttribute(hrefAttr, url); | 290     anchor->setAttribute(hrefAttr, url); | 
| 291     m_current->parserAppendChild(anchor); | 291     m_current->parserAppendChild(anchor); | 
| 292     return anchor.release(); | 292     return anchor.release(); | 
| 293 } | 293 } | 
| 294 | 294 | 
| 295 } | 295 } | 
| OLD | NEW | 
|---|