Changeset 44608 in webkit
- Timestamp:
- Jun 11, 2009 11:15:05 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r44602 r44608 1 2009-06-11 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 https://bugs.webkit.org/show_bug.cgi?id=25512 6 Handle texts after unfinished special tags (i.e., script, style, textarea, 7 title, xmp, and iframe) as the text node under the tags in view-source mode. 8 Before this change, all texts in unfinished special tags cannot be seen even in view-source mode. 9 10 This was already done only for title. This change allows other special tags to be handled as well. 11 12 The test case verifies if the texts in the unfinished special tags are visible in view-source mode. Also, fixed window-shadow-location-using-* tests so that they don't use unfinished iframe anymore. 13 14 * fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString-expected.txt: 15 * fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString.html: 16 * fast/dom/Window/Location/window-shadow-location-using-string-expected.txt: 17 * fast/dom/Window/Location/window-shadow-location-using-string.html: 18 * fast/frames/resources/viewsource-frame-unfinished-script.html: Added. 19 * fast/frames/resources/viewsource-frame-unfinished-textarea.html: Added. 20 * fast/frames/viewsource-unfinished-tags-expected.txt: Added. 21 * fast/frames/viewsource-unfinished-tags.html: Added. 22 1 23 2009-06-10 Brent Fulgham <bfulgham@gmail.com> 2 24 -
trunk/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString-expected.txt
r42218 r44608 1 PASS successfullyParsed is true 2 3 TEST COMPLETE 1 4 PASS result is 'pass.html' 2 5 -
trunk/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString.html
r42218 r44608 23 23 successfullyParsed = true; 24 24 </script> 25 <iframe onload="frameLoaded()" src="resources/window-shadow-location-using-js-object-with-toString-iframe.html"> 25 <iframe onload="frameLoaded()" src="resources/window-shadow-location-using-js-object-with-toString-iframe.html"></iframe> 26 26 <script src="../../../js/resources/js-test-post.js"></script> 27 27 </body> -
trunk/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-string-expected.txt
r42218 r44608 1 PASS successfullyParsed is true 2 3 TEST COMPLETE 1 4 PASS result is 'pass.html' 2 5 -
trunk/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-string.html
r42218 r44608 23 23 successfullyParsed = true; 24 24 </script> 25 <iframe onload="frameLoaded()" src="resources/window-shadow-location-using-string-iframe.html"> 25 <iframe onload="frameLoaded()" src="resources/window-shadow-location-using-string-iframe.html"></iframe> 26 26 <script src="../../../js/resources/js-test-post.js"></script> 27 27 </body> -
trunk/WebCore/ChangeLog
r44605 r44608 1 2009-06-11 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 https://bugs.webkit.org/show_bug.cgi?id=25512 6 Handle texts after unfinished special tags (i.e., script, style, textarea, 7 title, xmp, and iframe) as the text node under the tags in view-source mode. 8 Before this change, all texts in unfinished special tags cannot be seen even in view-source mode. 9 10 This was already done only for title. This change allows other special tags to be handled as well. 11 12 Test: fast/frames/viewsource-unfinished-tags.html 13 14 * html/HTMLTokenizer.cpp: 15 (WebCore::HTMLTokenizer::parseNonHTMLText): 16 (WebCore::HTMLTokenizer::parseTag): 17 (WebCore::HTMLTokenizer::write): 18 * html/HTMLTokenizer.h: 19 (WebCore::HTMLTokenizer::State::inAnyNonHTMLText): 20 1 21 2009-06-11 Yongjun Zhang <yongjun.zhang@nokia.com> 2 22 -
trunk/WebCore/html/HTMLTokenizer.cpp
r43842 r44608 317 317 } 318 318 319 HTMLTokenizer::State HTMLTokenizer::parse Special(SegmentedString& src, State state)319 HTMLTokenizer::State HTMLTokenizer::parseNonHTMLText(SegmentedString& src, State state) 320 320 { 321 321 ASSERT(state.inTextArea() || state.inTitle() || state.inIFrame() || !state.hasEntityState()); … … 1478 1478 m_cBufferPos = cBufferPos; 1479 1479 if (n || inViewSourceMode()) { 1480 State savedState = state; 1481 SegmentedString savedSrc = src; 1482 long savedLineno = m_lineNumber; 1480 1483 if ((tagName == preTag || tagName == listingTag) && !inViewSourceMode()) { 1481 1484 if (beginTag) … … 1490 1493 m_searchStopperLength = 8; 1491 1494 state.setInScript(true); 1492 state = parse Special(src, state);1495 state = parseNonHTMLText(src, state); 1493 1496 } else if (isSelfClosingScript) { // Handle <script src="foo"/> 1494 1497 state.setInScript(true); … … 1500 1503 m_searchStopperLength = 7; 1501 1504 state.setInStyle(true); 1502 state = parse Special(src, state);1505 state = parseNonHTMLText(src, state); 1503 1506 } 1504 1507 } else if (tagName == textareaTag) { … … 1507 1510 m_searchStopperLength = 10; 1508 1511 state.setInTextArea(true); 1509 state = parse Special(src, state);1512 state = parseNonHTMLText(src, state); 1510 1513 } 1511 1514 } else if (tagName == titleTag) { … … 1513 1516 m_searchStopper = titleEnd; 1514 1517 m_searchStopperLength = 7; 1515 State savedState = state;1516 SegmentedString savedSrc = src;1517 long savedLineno = m_lineNumber;1518 1518 state.setInTitle(true); 1519 state = parseSpecial(src, state); 1520 if (state.inTitle() && src.isEmpty()) { 1521 // We just ate the rest of the document as the title #text node! 1522 // Reset the state then retokenize without special title handling. 1523 // Let the parser clean up the missing </title> tag. 1524 // FIXME: This is incorrect, because src.isEmpty() doesn't mean we're 1525 // at the end of the document unless m_noMoreData is also true. We need 1526 // to detect this case elsewhere, and save the state somewhere other 1527 // than a local variable. 1528 state = savedState; 1529 src = savedSrc; 1530 m_lineNumber = savedLineno; 1531 m_scriptCodeSize = 0; 1532 } 1519 state = parseNonHTMLText(src, state); 1533 1520 } 1534 1521 } else if (tagName == xmpTag) { … … 1537 1524 m_searchStopperLength = 5; 1538 1525 state.setInXmp(true); 1539 state = parse Special(src, state);1526 state = parseNonHTMLText(src, state); 1540 1527 } 1541 1528 } else if (tagName == iframeTag) { … … 1544 1531 m_searchStopperLength = 8; 1545 1532 state.setInIFrame(true); 1546 state = parse Special(src, state);1533 state = parseNonHTMLText(src, state); 1547 1534 } 1535 } 1536 if (src.isEmpty() && (state.inTitle() || inViewSourceMode()) && !state.inComment() && !(state.inScript() && m_currentScriptTagStartLineNumber)) { 1537 // We just ate the rest of the document as the #text node under the special tag! 1538 // Reset the state then retokenize without special handling. 1539 // Let the parser clean up the missing close tag. 1540 // FIXME: This is incorrect, because src.isEmpty() doesn't mean we're 1541 // at the end of the document unless m_noMoreData is also true. We need 1542 // to detect this case elsewhere, and save the state somewhere other 1543 // than a local variable. 1544 state = savedState; 1545 src = savedSrc; 1546 m_lineNumber = savedLineno; 1547 m_scriptCodeSize = 0; 1548 1548 } 1549 1549 } … … 1662 1662 else if (state.inPlainText()) 1663 1663 state = parseText(m_src, state); 1664 else if (state.inAny Special())1665 state = parse Special(m_src, state);1664 else if (state.inAnyNonHTMLText()) 1665 state = parseNonHTMLText(m_src, state); 1666 1666 else if (state.inComment()) 1667 1667 state = parseComment(m_src, state); -
trunk/WebCore/html/HTMLTokenizer.h
r41130 r44608 174 174 State parseServer(SegmentedString&, State); 175 175 State parseText(SegmentedString&, State); 176 State parse Special(SegmentedString&, State);176 State parseNonHTMLText(SegmentedString&, State); 177 177 State parseTag(SegmentedString&, State); 178 178 State parseEntity(SegmentedString&, UChar*& dest, State, unsigned& cBufferPos, bool start, bool parsingTag); … … 289 289 void setForceSynchronous(bool v) { setBit(ForceSynchronous, v); } 290 290 291 bool inAny Special() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame); }291 bool inAnyNonHTMLText() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame); } 292 292 bool hasTagState() const { return m_bits & TagMask; } 293 293 bool hasEntityState() const { return m_bits & EntityMask; }
Note: See TracChangeset
for help on using the changeset viewer.