Changeset 30127 in webkit
- Timestamp:
- Feb 10, 2008 2:30:04 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r30123 r30127 1 2008-02-10 David Hyatt <hyatt@apple.com> 2 3 Fix for bug 17253. <iframe> contents need to be reflected into the DOM as a single text node. 4 5 Reviewed by olliej 6 7 fast/frames/iframe-text-contents.html 8 9 * html/HTMLParser.cpp: 10 (WebCore::HTMLParser::getNode): 11 * html/HTMLTokenizer.cpp: 12 (WebCore::HTMLTokenizer::parseSpecial): 13 (WebCore::HTMLTokenizer::parseComment): 14 (WebCore::HTMLTokenizer::parseTag): 15 * html/HTMLTokenizer.h: 16 (WebCore::HTMLTokenizer::State::inIFrame): 17 (WebCore::HTMLTokenizer::State::setInIFrame): 18 (WebCore::HTMLTokenizer::State::inAnySpecial): 19 (WebCore::HTMLTokenizer::State::needsSpecialWriteHandling): 20 (WebCore::HTMLTokenizer::State::): 21 1 22 2008-02-10 Andrew Wellington <proton@wiretapped.net> 2 23 -
trunk/WebCore/html/HTMLParser.cpp
r30112 r30127 678 678 } 679 679 680 bool HTMLParser::iframeCreateErrorCheck(Token* t, RefPtr<Node>& result)681 {682 // a bit of a special case, since the frame is inlined683 setSkipMode(iframeTag);684 return true;685 }686 687 680 bool HTMLParser::formCreateErrorCheck(Token* t, RefPtr<Node>& result) 688 681 { … … 799 792 gFunctionMap.set(headTag.localName().impl(), &HTMLParser::headCreateErrorCheck); 800 793 gFunctionMap.set(iTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck); 801 gFunctionMap.set(iframeTag.localName().impl(), &HTMLParser::iframeCreateErrorCheck);802 794 gFunctionMap.set(isindexTag.localName().impl(), &HTMLParser::isindexCreateErrorCheck); 803 795 gFunctionMap.set(liTag.localName().impl(), &HTMLParser::nestedCreateErrorCheck); -
trunk/WebCore/html/HTMLTokenizer.cpp
r30050 r30127 86 86 static const char textareaEnd [] = "</textarea"; 87 87 static const char titleEnd [] = "</title"; 88 static const char iframeEnd [] = "</iframe"; 88 89 89 90 // Full support for MS Windows extensions to Latin-1. … … 293 294 HTMLTokenizer::State HTMLTokenizer::parseSpecial(SegmentedString &src, State state) 294 295 { 295 ASSERT(state.inTextArea() || state.inTitle() || !state.hasEntityState());296 ASSERT(state.inTextArea() || state.inTitle() || state.inIFrame() || !state.hasEntityState()); 296 297 ASSERT(!state.hasTagState()); 297 ASSERT(state.inXmp() + state.inTextArea() + state.inTitle() + state.inStyle() + state.inScript() == 1 );298 ASSERT(state.inXmp() + state.inTextArea() + state.inTitle() + state.inStyle() + state.inScript() + state.inIFrame() == 1 ); 298 299 if (state.inScript()) 299 300 scriptStartLineno = m_lineNumber; … … 333 334 currToken.tagName = xmpTag.localName(); 334 335 currToken.beginTag = false; 336 } else if (state.inIFrame()) { 337 currToken.tagName = iframeTag.localName(); 338 currToken.beginTag = false; 335 339 } 336 340 processToken(); … … 340 344 state.setInTitle(false); 341 345 state.setInXmp(false); 346 state.setInIFrame(false); 342 347 tquote = NoQuote; 343 348 scriptCodeSize = scriptCodeResync = 0; … … 362 367 } 363 368 state.setEscaped(!state.escaped() && ch == '\\'); 364 if (!scriptCodeResync && (state.inTextArea() || state.inTitle() ) && !src.escaped() && ch == '&') {369 if (!scriptCodeResync && (state.inTextArea() || state.inTitle() || state.inIFrame()) && !src.escaped() && ch == '&') { 365 370 UChar* scriptCodeDest = scriptCode+scriptCodeSize; 366 371 src.advancePastNonNewline(); … … 579 584 if (handleBrokenComments || endCharsCount > 1) { 580 585 src.advancePastNonNewline(); 581 if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() )) {586 if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() || state.inIFrame())) { 582 587 checkScriptBuffer(); 583 588 scriptCode[scriptCodeSize] = 0; … … 1287 1292 state = parseSpecial(src, state); 1288 1293 } 1294 } else if (tagName == iframeTag) { 1295 if (beginTag) { 1296 searchStopper = iframeEnd; 1297 searchStopperLen = 8; 1298 state.setInIFrame(true); 1299 state = parseSpecial(src, state); 1300 } 1289 1301 } 1290 1302 } -
trunk/WebCore/html/HTMLTokenizer.h
r29805 r30127 213 213 bool inTitle() const { return testBit(InTitle); } 214 214 void setInTitle(bool v) { setBit(InTitle, v); } 215 bool inIFrame() const { return testBit(InIFrame); } 216 void setInIFrame(bool v) { setBit(InIFrame, v); } 215 217 bool inPlainText() const { return testBit(InPlainText); } 216 218 void setInPlainText(bool v) { setBit(InPlainText, v); } … … 238 240 void setForceSynchronous(bool v) { setBit(ForceSynchronous, v); } 239 241 240 bool inAnySpecial() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle ); }242 bool inAnySpecial() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame); } 241 243 bool hasTagState() const { return m_bits & TagMask; } 242 244 bool hasEntityState() const { return m_bits & EntityMask; } 243 245 244 bool needsSpecialWriteHandling() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | TagMask | EntityMask | InPlainText | InComment | InServer | InProcessingInstruction | StartTag); }246 bool needsSpecialWriteHandling() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame | TagMask | EntityMask | InPlainText | InComment | InServer | InProcessingInstruction | StartTag); } 245 247 246 248 private: … … 265 267 AllowYield = 1 << 21, 266 268 LoadingExtScript = 1 << 22, 267 ForceSynchronous = 1 << 23 269 ForceSynchronous = 1 << 23, 270 InIFrame = 1 << 24 268 271 }; 269 272
Note: See TracChangeset
for help on using the changeset viewer.