зеркало из https://github.com/mozilla/gecko-dev.git
Back out bug 658949 because of perma orange on Windows Reftests.
This commit is contained in:
Родитель
a094756416
Коммит
c82951ef5c
|
@ -31,7 +31,7 @@ function test() {
|
|||
|
||||
content.location =
|
||||
"data:text/html," +
|
||||
"<style type='text/css'>%23test-image,%23not-test-image {background-image: url('about:logo?c');}</style>" +
|
||||
"<style type='text/css'>#test-image,#not-test-image {background-image: url('about:logo?c');}</style>" +
|
||||
"<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" +
|
||||
"<img src='about:logo?b' height=300 width=350 alt=2>" +
|
||||
"<img src='about:logo?a' height=200 width=250>" +
|
||||
|
|
|
@ -15,12 +15,12 @@ function test() {
|
|||
}
|
||||
|
||||
// very long page that produces black bars at the right
|
||||
let html1 = '<html><body style="background-color: %2300f;">' +
|
||||
'<div style="background: %23fff; width: 95%; height: 10000px; ' +
|
||||
let html1 = '<html><body style="background-color: #00f;">' +
|
||||
'<div style="background: #fff; width: 95%; height: 10000px; ' +
|
||||
' margin: 0 auto;"></div></body></html>';
|
||||
|
||||
// very short page that produces black bars at the bottom
|
||||
let html2 = '<html><body style="background-color: %2300f;"></body></html>';
|
||||
let html2 = '<html><body style="background-color: #00f;"></body></html>';
|
||||
|
||||
let tests = [{
|
||||
url: 'data:text/html,' + html1,
|
||||
|
|
|
@ -189,7 +189,7 @@ SimpleTest.waitForFocus(runTest);
|
|||
<button id="b2" label="Button"/>
|
||||
<button id="b3" label="Button"/>
|
||||
|
||||
<iframe id="child" src="data:text/html,<html><style>* { outline: none; -moz-appearance: none; } %23elem:focus { outline: 2px solid red; } %23elem:-moz-focusring { outline: 1px solid blue; }</style><div id='container'></html>"/>
|
||||
<iframe id="child" src="data:text/html,<html><style>* { outline: none; -moz-appearance: none; } #elem:focus { outline: 2px solid red; } #elem:-moz-focusring { outline: 1px solid blue; }</style><div id='container'></html>"/>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* 我听见 我忘记; 我看见 我记住; 我做 我了解。
|
||||
*/
|
||||
|
||||
const sample = "~{NJK{K-JGI59OAK~}5~{7VVS!%235+JG%23,K{K-2;R*GsHTH;JGR;8vI59OS@T6!%23~} ~{NRL}<{~} ~{NRM|<G~}; ~{NR?4<{~} ~{NR<GW!~}; ~{NRWv~} ~{NRAK=b!%23~}";
|
||||
const sample = "~{NJK{K-JGI59OAK~}5~{7VVS!#5+JG#,K{K-2;R*GsHTH;JGR;8vI59OS@T6!#~} ~{NRL}<{~} ~{NRM|<G~}; ~{NR?4<{~} ~{NR<GW!~}; ~{NRWv~} ~{NRAK=b!#~}";
|
||||
|
||||
const expected = "\u95EE\u4ED6\u8C01\u662F\u50BB\u74DC\u4E865\u5206\u949F\u3002\u4F46\u662F\uFF0C\u4ED6\u8C01\u4E0D\u8981\u6C42\u4ECD\u7136\u662F\u4E00\u4E2A\u50BB\u74DC\u6C38\u8FDC\u3002 \u6211\u542C\u89C1 \u6211\u5FD8\u8BB0; \u6211\u770B\u89C1 \u6211\u8BB0\u4F4F; \u6211\u505A \u6211\u4E86\u89E3\u3002";
|
||||
|
||||
|
|
|
@ -46,10 +46,9 @@ function run()
|
|||
function test_document_rule(urltests, shouldapply)
|
||||
{
|
||||
var zIndex = ++zIndexCounter;
|
||||
var encodedRule = encodeURI("@-moz-document " + urltests + " { ") +
|
||||
"%23" + // encoded hash character for "#display"
|
||||
encodeURI("display { z-index: " + zIndex + " } }");
|
||||
var sheeturi = "data:text/css," + encodedRule;
|
||||
var rule = "@-moz-document " + urltests +
|
||||
" { #display { z-index: " + zIndex + " } }";
|
||||
var sheeturi = "data:text/css," + encodeURI(rule);
|
||||
set_user_sheet(sheeturi);
|
||||
if (shouldapply) {
|
||||
is(cs.zIndex, zIndex,
|
||||
|
|
|
@ -104,13 +104,13 @@ base + "#6ident, #a {color: red }",
|
|||
".\\--ident, .a { color: green; }",
|
||||
|
||||
// CSS2.1 section 4.1.5 and 4.2
|
||||
"@import 'data:text/css,%23a{color:green}';",
|
||||
"@import \"data:text/css,%23a{color:green}\";",
|
||||
"@import url(data:text/css,%23a{color:green});",
|
||||
"@import 'data:text/css,%23a{color:green}' screen;",
|
||||
base + "@import 'data:text/css,%23a{color:red}' blahblahblah;",
|
||||
"@import 'data:text/css,%23a{color:green}'",
|
||||
"@import 'data:text/css,%23a{color:green}",
|
||||
"@import 'data:text/css,#a{color:green}';",
|
||||
"@import \"data:text/css,#a{color:green}\";",
|
||||
"@import url(data:text/css,#a{color:green});",
|
||||
"@import 'data:text/css,#a{color:green}' screen;",
|
||||
base + "@import 'data:text/css,#a{color:red}' blahblahblah;",
|
||||
"@import 'data:text/css,#a{color:green}'",
|
||||
"@import 'data:text/css,#a{color:green}",
|
||||
"@foo {}" + base,
|
||||
"@foo bar {}" + base,
|
||||
"@foo; " + base,
|
||||
|
|
|
@ -115,10 +115,8 @@ nsSimpleURI::Read(nsIObjectInputStream* aStream)
|
|||
mIsRefValid = isRefValid;
|
||||
|
||||
if (isRefValid) {
|
||||
rv = aStream->ReadCString(mRef);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
} else {
|
||||
mRef.Truncate(); // invariant: mRef should be empty when it's not valid
|
||||
rv = aStream->ReadCString(mRef);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -168,7 +166,6 @@ nsSimpleURI::Read(const IPC::Message *aMsg, void **aIter)
|
|||
if (mIsRefValid) {
|
||||
return ReadParam(aMsg, aIter, &mRef);
|
||||
}
|
||||
mRef.Truncate(); // invariant: mRef should be empty when it's not valid
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
@ -194,8 +191,6 @@ nsSimpleURI::GetSpec(nsACString &result)
|
|||
result = mScheme + NS_LITERAL_CSTRING(":") + mPath;
|
||||
if (mIsRefValid) {
|
||||
result += NS_LITERAL_CSTRING("#") + mRef;
|
||||
} else {
|
||||
NS_ABORT_IF_FALSE(mRef.IsEmpty(), "mIsRefValid/mRef invariant broken");
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -373,7 +368,6 @@ nsSimpleURI::SetPath(const nsACString &path)
|
|||
PRInt32 hashPos = path.FindChar('#');
|
||||
if (hashPos < 0) {
|
||||
mIsRefValid = PR_FALSE;
|
||||
mRef.Truncate(); // invariant: mRef should be empty when it's not valid
|
||||
mPath = path;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -386,7 +380,6 @@ NS_IMETHODIMP
|
|||
nsSimpleURI::GetRef(nsACString &result)
|
||||
{
|
||||
if (!mIsRefValid) {
|
||||
NS_ABORT_IF_FALSE(mRef.IsEmpty(), "mIsRefValid/mRef invariant broken");
|
||||
result.Truncate();
|
||||
} else {
|
||||
result = mRef;
|
||||
|
@ -405,7 +398,7 @@ nsSimpleURI::SetRef(const nsACString &aRef)
|
|||
if (aRef.IsEmpty()) {
|
||||
// Empty string means to remove ref completely.
|
||||
mIsRefValid = PR_FALSE;
|
||||
mRef.Truncate(); // invariant: mRef should be empty when it's not valid
|
||||
mRef.Truncate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -510,7 +503,6 @@ nsSimpleURI::CloneInternal(nsSimpleURI::RefHandlingEnum refHandlingMode,
|
|||
url->mPath = mPath;
|
||||
if (refHandlingMode == eHonorRef) {
|
||||
url->mRef = mRef;
|
||||
url->mIsRefValid = mIsRefValid;
|
||||
}
|
||||
|
||||
url.forget(result);
|
||||
|
|
|
@ -62,10 +62,10 @@ nsDataChannel::OpenContentStream(PRBool async, nsIInputStream **result,
|
|||
rv = URI()->GetAsciiSpec(spec);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCString contentType, contentCharset, dataBuffer, hashRef;
|
||||
nsCString contentType, contentCharset, dataBuffer;
|
||||
PRBool lBase64;
|
||||
rv = nsDataHandler::ParseURI(spec, contentType, contentCharset,
|
||||
lBase64, dataBuffer, hashRef);
|
||||
lBase64, dataBuffer);
|
||||
|
||||
NS_UnescapeURL(dataBuffer);
|
||||
|
||||
|
|
|
@ -114,9 +114,9 @@ nsDataHandler::NewURI(const nsACString &aSpec,
|
|||
rv = uri->SetRef(spec);
|
||||
} else {
|
||||
// Otherwise, we'll assume |spec| is a fully-specified data URI
|
||||
nsCAutoString contentType, contentCharset, dataBuffer, hashRef;
|
||||
nsCAutoString contentType, contentCharset, dataBuffer;
|
||||
PRBool base64;
|
||||
rv = ParseURI(spec, contentType, contentCharset, base64, dataBuffer, hashRef);
|
||||
rv = ParseURI(spec, contentType, contentCharset, base64, dataBuffer);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
|
@ -171,8 +171,7 @@ nsDataHandler::ParseURI(nsCString& spec,
|
|||
nsCString& contentType,
|
||||
nsCString& contentCharset,
|
||||
PRBool& isBase64,
|
||||
nsCString& dataBuffer,
|
||||
nsCString& hashRef) {
|
||||
nsCString& dataBuffer) {
|
||||
isBase64 = PR_FALSE;
|
||||
|
||||
// move past "data:"
|
||||
|
@ -231,16 +230,7 @@ nsDataHandler::ParseURI(nsCString& spec,
|
|||
contentType.StripWhitespace();
|
||||
contentCharset.StripWhitespace();
|
||||
|
||||
// Split encoded data from terminal "#ref" (if present)
|
||||
char *data = comma + 1;
|
||||
char *hash = strchr(data, '#');
|
||||
if (!hash) {
|
||||
dataBuffer.Assign(data);
|
||||
hashRef.Truncate();
|
||||
} else {
|
||||
dataBuffer.Assign(data, hash - data);
|
||||
hashRef.Assign(hash);
|
||||
}
|
||||
dataBuffer.Assign(comma + 1);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -63,8 +63,7 @@ public:
|
|||
nsCString& contentType,
|
||||
nsCString& contentCharset,
|
||||
PRBool& isBase64,
|
||||
nsCString& dataBuffer,
|
||||
nsCString& hashRef);
|
||||
nsCString& dataBuffer);
|
||||
};
|
||||
|
||||
#endif /* nsDataHandler_h___ */
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<iframe src="data:text/html,ABC"></iframe>
|
|
@ -1 +0,0 @@
|
|||
<iframe src="data:text/html,ABC#myRef"></iframe>
|
|
@ -1,2 +1,2 @@
|
|||
== bug565432-1.html bug565432-1-ref.html
|
||||
== 658949-1.html 658949-1-ref.html
|
||||
|
||||
|
|
|
@ -5,12 +5,6 @@ const Ci = Components.interfaces;
|
|||
// TEST DATA
|
||||
// ---------
|
||||
var gTests = [
|
||||
{ spec: "about:blank",
|
||||
scheme: "about",
|
||||
prePath: "about:",
|
||||
path: "blank",
|
||||
ref: "",
|
||||
nsIURL: false, nsINestedURI: true, immutable: true },
|
||||
{ spec: "about:foobar",
|
||||
scheme: "about",
|
||||
prePath: "about:",
|
||||
|
@ -83,12 +77,6 @@ var gTests = [
|
|||
path: "resource://gre/chrome.toolkit.jar!/",
|
||||
ref: "",
|
||||
nsIURL: true, nsINestedURI: true },
|
||||
{ spec: "place:redirectsMode=2&sort=8&maxResults=10",
|
||||
scheme: "place",
|
||||
prePath: "place:",
|
||||
path: "redirectsMode=2&sort=8&maxResults=10",
|
||||
ref: "",
|
||||
nsIURL: false, nsINestedURI: false },
|
||||
{ spec: "resource://gre/",
|
||||
scheme: "resource",
|
||||
prePath: "resource://gre",
|
||||
|
@ -230,10 +218,6 @@ function do_test_uri_with_hash_suffix(aTest, aSuffix) {
|
|||
var testURI = NetUtil.newURI(aTest.spec + aSuffix);
|
||||
var origURI = NetUtil.newURI(aTest.spec);
|
||||
|
||||
do_info("testing " + aTest.spec + " with '" + aSuffix + "' appended " +
|
||||
"equals a clone of itself");
|
||||
do_check_uri_eq(testURI, testURI.clone());
|
||||
|
||||
do_info("testing " + aTest.spec +
|
||||
" doesn't equal self with '" + aSuffix + "' appended");
|
||||
if (aTest.spec == "file://") {
|
||||
|
|
Загрузка…
Ссылка в новой задаче