Changeset 90082 in webkit
- Timestamp:
- Jun 29, 2011 8:05:03 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90068 r90082 1 2011-06-29 Keishi Hattori <keishi@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Remove extra space at EOL in view source mode 6 https://bugs.webkit.org/show_bug.cgi?id=63620 7 8 * fast/frames/resources/viewsource-frame-5.html: Added. 9 * fast/frames/viewsource-empty-attribute-value-expected.txt: Regenerated. 10 * fast/frames/viewsource-linebreak-expected.txt: Added. 11 * fast/frames/viewsource-linebreak.html: Added. Test that there are no extra spaces at EOL. 12 And that the multiple consecutive line breaks are maintained in the frame. 13 1 14 2011-06-23 Abhishek Arya <inferno@chromium.org> 2 15 -
trunk/LayoutTests/fast/frames/viewsource-empty-attribute-value-expected.txt
r34134 r90082 8 8 Frame: 'sourceFrame' 9 9 -------- 10 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 11 <hr noshade width=75%> 12 <div align="center" title="" id="foo"> 13 <p>hello world</p> 14 </div> 10 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 11 <hr noshade width=75%> 12 <div align="center" title="" id="foo"> 13 <p>hello world</p> 14 </div> 15 -
trunk/Source/WebCore/ChangeLog
r90075 r90082 1 2011-06-29 Keishi Hattori <keishi@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Remove extra space at EOL in view source mode 6 https://bugs.webkit.org/show_bug.cgi?id=63620 7 8 Test: fast/frames/viewsource-linebreak.html 9 10 * css/view-source.css: 11 (tbody:last-child .webkit-line-content:empty:before): If we don't do this 12 the last line will be empty and the height will be shorter than the rest. 13 * html/HTMLViewSourceDocument.cpp: 14 (WebCore::HTMLViewSourceDocument::addSource): If source file is empty, add an empty line. 15 (WebCore::HTMLViewSourceDocument::finishLine): Call when you are done with the current line. 16 Adds a BR element if the line is empty and sets current to tbody. 17 (WebCore::HTMLViewSourceDocument::addText): 18 * html/HTMLViewSourceDocument.h: 19 1 20 2011-06-29 Brent Fulgham <bfulgham@webkit.org> 2 21 -
trunk/Source/WebCore/css/view-source.css
r71348 r90082 75 75 counter-increment: lines; 76 76 -webkit-user-select: none 77 } 78 79 tbody:last-child .webkit-line-content:empty:before { 80 content: " "; 77 81 } 78 82 -
trunk/Source/WebCore/html/HTMLViewSourceDocument.cpp
r87309 r90082 29 29 #include "DOMImplementation.h" 30 30 #include "HTMLAnchorElement.h" 31 #include "HTMLBRElement.h" 31 32 #include "HTMLBaseElement.h" 32 33 #include "HTMLBodyElement.h" … … 111 112 break; 112 113 case HTMLToken::EndOfFile: 114 if (!m_tbody->hasChildNodes()) 115 addLine(String()); 113 116 break; 114 117 case HTMLToken::StartTag: … … 235 238 } 236 239 240 void HTMLViewSourceDocument::finishLine() 241 { 242 if (!m_current->hasChildNodes()) { 243 RefPtr<HTMLBRElement> br = HTMLBRElement::create(this); 244 m_current->parserAddChild(br); 245 br->attach(); 246 } 247 m_current = m_tbody; 248 } 249 237 250 void HTMLViewSourceDocument::addText(const String& text, const AtomicString& className) 238 251 { … … 246 259 for (unsigned i = 0; i < size; i++) { 247 260 String substring = lines[i]; 261 if (m_current == m_tbody) 262 addLine(className); 248 263 if (substring.isEmpty()) { 249 264 if (i == size - 1) 250 265 break; 251 substring = " "; 266 finishLine(); 267 continue; 252 268 } 253 if (m_current == m_tbody)254 addLine(className);255 269 RefPtr<Text> t = Text::create(this, substring); 256 270 m_current->parserAddChild(t); 257 271 t->attach(); 258 272 if (i < size - 1) 259 m_current = m_tbody; 260 } 261 262 // Set current to m_tbody if the last character was a newline. 263 if (text[text.length() - 1] == '\n') 264 m_current = m_tbody; 273 finishLine(); 274 } 265 275 } 266 276 -
trunk/Source/WebCore/html/HTMLViewSourceDocument.h
r66957 r90082 57 57 PassRefPtr<Element> addSpanWithClassName(const AtomicString&); 58 58 void addLine(const AtomicString& className); 59 void finishLine(); 59 60 void addText(const String& text, const AtomicString& className); 60 61 int addRange(const String& source, int start, int end, const String& className, bool isLink = false, bool isAnchor = false);
Note: See TracChangeset
for help on using the changeset viewer.