Changeset 19433 in webkit
- Timestamp:
- Feb 6, 2007 9:17:24 AM (17 years ago)
- Location:
- S60/branches/3.1m/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
S60/branches/3.1m/WebCore/ChangeLog
r19431 r19433 1 w3liu, Reviewed by Yongjun Zhang <yongjun.zhang@nokia.com> 2 DESC: Should check meta for charset if meta exists EHSN-6UQ6CM 3 http://bugs.webkit.org/show_bug.cgi?id=12225 4 5 WARNING: NO TEST CASES ADDED OR CHANGED 6 7 * khtml/misc/decoder.cpp: 8 (Decoder::decode): 9 1 10 yongjzha, Reviewed by Zalan. 2 11 -
S60/branches/3.1m/WebCore/khtml/misc/decoder.cpp
r19052 r19433 485 485 const char *pEnd = buffer.length(); 486 486 #endif 487 #if NOKIA_CHANGES 488 bool hasMeta = buffer.find("<meta", 0, false); 489 bool reachMeta = false; 490 #endif 487 491 while(ptr != pEnd) 488 492 { … … 533 537 switch( id ) { 534 538 case ID_META: 535 { 539 { 540 #if NOKIA_CHANGES 541 reachMeta = true; 542 #endif 536 543 // found a meta tag... 537 544 //ptr += 5; … … 544 551 //if( (pos = str.find("http-equiv", pos)) == -1) break; 545 552 //if( (pos = str.find("content-type", pos)) == -1) break; 546 while( pos < ( int ) str.length() ) {547 if( (pos = str.find("charset", pos, false)) == -1) break;548 pos += 7;553 while( pos < ( int ) str.length() ) { 554 if( (pos = str.find("charset", pos, false)) == -1) break; 555 pos += 7; 549 556 // skip whitespace.. 550 while( pos < (int)str.length() && str[pos] <= ' ' ) pos++;557 while( pos < (int)str.length() && str[pos] <= ' ' ) pos++; 551 558 if ( pos == ( int )str.length()) break; 552 559 if ( str[pos++] != '=' ) continue; 553 560 while ( pos < ( int )str.length() && 554 555 pos++;556 561 ( str[pos] <= ' ' ) || str[pos] == '=' || str[pos] == '"' || str[pos] == '\'') 562 pos++; 563 557 564 // end ? 558 565 if ( pos == ( int )str.length() ) break; 559 uint endpos = pos;560 while( endpos < str.length() &&561 562 563 endpos++;564 #ifdef DECODE_DEBUG 565 kdDebug( 6005 ) << "Decoder: found charset: " << str.mid(pos, endpos-pos) << endl;566 #endif 567 setEncoding(str.mid(pos, endpos-pos), EncodingFromMetaTag);568 if( m_type == EncodingFromMetaTag ) goto found;569 566 uint endpos = pos; 567 while( endpos < str.length() && 568 (str[endpos] != ' ' && str[endpos] != '"' && str[endpos] != '\'' 569 && str[endpos] != ';' && str[endpos] != '>') ) 570 endpos++; 571 #ifdef DECODE_DEBUG 572 kdDebug( 6005 ) << "Decoder: found charset: " << str.mid(pos, endpos-pos) << endl; 573 #endif 574 setEncoding(str.mid(pos, endpos-pos), EncodingFromMetaTag); 575 if( m_type == EncodingFromMetaTag ) goto found; 576 570 577 if ( endpos >= str.length() || str[endpos] == '/' || str[endpos] == '>' ) break; 571 572 pos = endpos + 1;573 }574 }578 579 pos = endpos + 1; 580 } 581 } 575 582 case (ID_META+ID_CLOSE_TAG): 576 583 case ID_SCRIPT: … … 597 604 break; 598 605 default: 606 #if NOKIA_CHANGES 607 if (hasMeta && !reachMeta) 608 break; 609 #endif 599 610 body = true; 600 611 #ifdef DECODE_DEBUG
Note: See TracChangeset
for help on using the changeset viewer.