Adds a test for the CSS URL quoting logic.
* fast/inspector/cssURLQuotes-expected.txt: Added.
* fast/inspector/cssURLQuotes.html: Added.
WebCore:
Reviewed by Tim H.
<rdar://problem/
4699166> REGRESSION: Background images in Mail stationery do not load
Fixes the quoting logic. The previous logic did not account for the
CSS tokenizer's regex character range between * and ~ as valid in URL types.
* css/CSSPrimitiveValue.cpp:
(WebCore::isCSSTokenizerURL):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16275
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-08 Timothy Hatcher <timothy@apple.com>
+
+ Adds a test for the CSS URL quoting logic.
+
+ * fast/inspector/cssURLQuotes-expected.txt: Added.
+ * fast/inspector/cssURLQuotes.html: Added.
+
2006-09-09 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
--- /dev/null
+ALERT: url(file:///unquoted) (URL should not be quoted)
+ALERT: url(file:///noQuotesNeeded) (URL should not be quoted)
+ALERT: url('file:///should(Quote)') (URL should be quoted)
+
--- /dev/null
+<div id="testUnquoted" style="background-image: url(file:///unquoted)"></div>
+<div id="testNoQuotesNeeded" style="background-image: url('file:///noQuotesNeeded')"></div>
+<div id="testShouldQuote" style="background-image: url('file:///should(Quote)')"></div>
+<script>
+function test(id, reason) {
+ alert(document.getElementById(id).style.getPropertyValue("background-image") + " (" + reason + ")");
+}
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+test("testUnquoted", "URL should not be quoted");
+test("testNoQuotesNeeded", "URL should not be quoted");
+test("testShouldQuote", "URL should be quoted");
+</script>
+2006-09-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Tim H.
+
+ <rdar://problem/4699166> REGRESSION: Background images in Mail stationery do not load
+
+ Fixes the quoting logic. The previous logic did not account for the
+ CSS tokenizer's regex character range between * and ~ as valid in URL types.
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::isCSSTokenizerURL):
+
2006-09-09 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
const UChar* p = string.characters();
const UChar* end = p + string.length();
- for (; p != end; ++p)
- switch (p[0]) {
+ for (; p != end; ++p) {
+ UChar c = p[0];
+ switch (c) {
case '!':
case '#':
case '$':
case '%':
case '&':
- case '*':
- case '-':
- case '~':
break;
default:
- if (p[0] < 128)
+ if (c < '*')
+ return false;
+ if (c <= '~')
+ break;
+ if (c < 128)
return false;
}
+ }
return true;
}