+2007-12-20 johnnyding.webkit <johnnyding.webkit@gmail.com>
+
+ Reviewed by Alexey. Landed by Stephanie.
+
+ - bug http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
+ Test for unicode characters which is great than 255 are in HTML attribute name
+
+ * fast/parser/test-unicode-characters-in-attribute-name-expected.txt: Added.
+ * fast/parser/test-unicode-characters-in-attribute-name.html: Added.
+
2007-12-20 Eric Seidel <eric@webkit.org>
Reviewed by Nikolas Zimmermann.
--- /dev/null
+All attributes of the content element are:
+
+0. id : content
+1. title : http://www.315.com.cn/newwebsite/images0821/315_ca_03.gif
+2. la ng : zh-cn
+
+2007-12-19 johnnyding.webkit <johnnyding.webkit@gmail.com>
+
+ Reviewed by Alexey. Landed by Stephanie.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
+ Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
+ Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing
+ the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
+
+
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
+ (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
+ * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
+
2007-12-20 Eric Seidel <eric@webkit.org>
Reviewed by Nikolas Zimmermann.
state.setEntityState(SearchSemicolon);
if (state.entityState() == SearchSemicolon) {
if(cBufferPos > 1) {
- const Entity *e = findEntity(cBuffer, cBufferPos);
+ // Since the maximum length of entity name is 9,
+ // so a single char array which is allocated on
+ // the stack, its length is 10, should be OK.
+ // Also if we have an illegal character, we treat it
+ // as illegal entity name.
+ unsigned testedEntityNameLen = 0;
+ char tmpEntityNameBuffer[10];
+
+ ASSERT(cBufferPos < 10);
+ for (; testedEntityNameLen < cBufferPos; ++testedEntityNameLen) {
+ if (cBuffer[testedEntityNameLen] > 0x7e)
+ break;
+ tmpEntityNameBuffer[testedEntityNameLen] = cBuffer[testedEntityNameLen];
+ }
+
+ const Entity *e;
+
+ if (testedEntityNameLen == cBufferPos)
+ e = findEntity(tmpEntityNameBuffer, cBufferPos);
+ else
+ e = 0;
+
if(e)
EntityUnicodeValue = e->code;
state.setInComment(false);
src.advance(m_lineNumber);
if (!src.isEmpty())
- // cuts off high bits, which is okay
cBuffer[cBufferPos++] = *src;
}
else
m_cBufferPos = cBufferPos;
return state; // Finished parsing tag!
}
- // cuts off high bits, which is okay
cBuffer[cBufferPos++] = *src;
src.advance(m_lineNumber);
break;
// as attribute names. ### judge if this causes problems
if(finish || CBUFLEN == cBufferPos) {
bool beginTag;
- char* ptr = cBuffer;
+ UChar* ptr = cBuffer;
unsigned int len = cBufferPos;
cBuffer[cBufferPos] = '\0';
if ((cBufferPos > 0) && (*ptr == '/')) {
// So any fixed number might be too small, but rather than rewriting all usage of this buffer
// we'll just make it large enough to handle all imaginable cases.
#define CBUFLEN 1024
- char cBuffer[CBUFLEN + 2];
+ UChar cBuffer[CBUFLEN + 2];
unsigned int m_cBufferPos;
SegmentedString src;
my $testDirectory = getcwd() . "/LayoutTests";
my $iExploderDirectory = getcwd() . "/WebKitTools/iExploder";
my $httpdPath = "/usr/sbin/httpd";
- my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
- $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+ my $httpdConfig;
+ if (isCygwin()) {
+ my $windowsConfDirectory = "$testDirectory/http/conf/";
+ unless (-x "/usr/lib/apache/libphp4.dll") {
+ copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll");
+ chmod(0755, "/usr/lib/apache/libphp4.dll");
+ }
+ $httpdConfig = "$windowsConfDirectory/cygwin-httpd.conf";
+ } else {
+ $httpdConfig = "$testDirectory/http/conf/httpd.conf";
+ $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+ }
my $documentRoot = "$iExploderDirectory/htdocs";
my $typesConfig = "$testDirectory/http/conf/mime.types";
my $listen = "127.0.0.1:$httpdPort";
+ #my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
+ my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
- open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath,
+ my @args = (
"-f", "$httpdConfig",
"-C", "DocumentRoot \"$documentRoot\"",
"-C", "Listen $listen",
"-c", "CustomLog \"/tmp/WebKit/access_log.txt\" common",
"-c", "ErrorLog \"/tmp/WebKit/error_log.txt\"",
# Apache wouldn't run CGIs with permissions==700 otherwise
- "-c", "User \"#$<\"");
+ "-c", "User \"#$<\""
+ );
+
+ # FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
+ push(@args, "-c", "SSLCertificateFile \"$sslCertificate\"") unless isCygwin();
+
+ open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, @args);
+
my $retryCount = 20;
while (system("/usr/bin/curl -q --silent --stderr - --output /dev/null $listen") && $retryCount) {
} else {
runSafari();
print "Last generated tests:\n";
- system "grep 'Mangle attempt' /tmp/WebKit/error_log.txt | tail -n -5 | awk ' {print \$4}'";
+ system "grep 'Mangle attempt' /tmp/WebKit/error_log.txt | tail -n -5 | awk ' {print \$12}'";
}
closeHTTPD();
local %ENV;
$ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
- system "WebKitTools/Scripts/run-safari", "-NSOpen", "/tmp/WebKit/redirect.html";
+ system "WebKitTools/Scripts/run-safari /tmp/WebKit/redirect.html";
}
sub openHTTPDIfNeeded()
my $testDirectory = getcwd() . "/LayoutTests";
my $manglemeDirectory = getcwd() . "/WebKitBuild/mangleme";
my $httpdPath = "/usr/sbin/httpd";
- my $httpdConfig = "$testDirectory/http/conf/httpd.conf";
- $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+ my $httpdConfig;
+ if (isCygwin()) {
+ my $windowsConfDirectory = "$testDirectory/http/conf/";
+ unless (-x "/usr/lib/apache/libphp4.dll") {
+ copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll");
+ chmod(0755, "/usr/lib/apache/libphp4.dll");
+ }
+ $httpdConfig = "$windowsConfDirectory/cygwin-httpd.conf";
+ } else {
+ $httpdConfig = "$testDirectory/http/conf/httpd.conf";
+ $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;
+ }
my $documentRoot = "$manglemeDirectory";
my $typesConfig = "$testDirectory/http/conf/mime.types";
my $listen = "127.0.0.1:$httpdPort";
+ #my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
+ my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
- open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath,
+ my @args = (
"-f", "$httpdConfig",
"-C", "DocumentRoot \"$documentRoot\"",
"-C", "Listen $listen",
"-c", "CustomLog \"/tmp/WebKit/access_log.txt\" common",
"-c", "ErrorLog \"/tmp/WebKit/error_log.txt\"",
# Apache wouldn't run CGIs with permissions==700 otherwise
- "-c", "User \"#$<\"");
+ "-c", "User \"#$<\""
+ );
+
+ # FIXME: Enable this on Windows once <rdar://problem/5345985> is fixed
+ push(@args, "-c", "SSLCertificateFile \"$sslCertificate\"") unless isCygwin();
+
+ open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, @args);
+
my $retryCount = 20;
while (system("/usr/bin/curl -q --silent --stderr - --output /dev/null $listen") && $retryCount) {