Edit File by line
/home/barbar84/www/wp-inclu.../js/codemirr...
File: csslint.js
* first character is provided and the rest is read by the function to determine
[5000] Fix | Delete
* the correct token to create.
[5001] Fix | Delete
* @param {String} first The first character in the token.
[5002] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5003] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5004] Fix | Delete
* @return {Object} A token object.
[5005] Fix | Delete
* @method htmlCommentStartToken
[5006] Fix | Delete
*/
[5007] Fix | Delete
htmlCommentStartToken: function(first, startLine, startCol) {
[5008] Fix | Delete
var reader = this._reader,
[5009] Fix | Delete
text = first;
[5010] Fix | Delete
[5011] Fix | Delete
reader.mark();
[5012] Fix | Delete
text += reader.readCount(3);
[5013] Fix | Delete
[5014] Fix | Delete
if (text === "<!--") {
[5015] Fix | Delete
return this.createToken(Tokens.CDO, text, startLine, startCol);
[5016] Fix | Delete
} else {
[5017] Fix | Delete
reader.reset();
[5018] Fix | Delete
return this.charToken(first, startLine, startCol);
[5019] Fix | Delete
}
[5020] Fix | Delete
},
[5021] Fix | Delete
[5022] Fix | Delete
/**
[5023] Fix | Delete
* Produces a CDC or CHAR token based on the specified information. The
[5024] Fix | Delete
* first character is provided and the rest is read by the function to determine
[5025] Fix | Delete
* the correct token to create.
[5026] Fix | Delete
* @param {String} first The first character in the token.
[5027] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5028] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5029] Fix | Delete
* @return {Object} A token object.
[5030] Fix | Delete
* @method htmlCommentEndToken
[5031] Fix | Delete
*/
[5032] Fix | Delete
htmlCommentEndToken: function(first, startLine, startCol) {
[5033] Fix | Delete
var reader = this._reader,
[5034] Fix | Delete
text = first;
[5035] Fix | Delete
[5036] Fix | Delete
reader.mark();
[5037] Fix | Delete
text += reader.readCount(2);
[5038] Fix | Delete
[5039] Fix | Delete
if (text === "-->") {
[5040] Fix | Delete
return this.createToken(Tokens.CDC, text, startLine, startCol);
[5041] Fix | Delete
} else {
[5042] Fix | Delete
reader.reset();
[5043] Fix | Delete
return this.charToken(first, startLine, startCol);
[5044] Fix | Delete
}
[5045] Fix | Delete
},
[5046] Fix | Delete
[5047] Fix | Delete
/**
[5048] Fix | Delete
* Produces an IDENT or FUNCTION token based on the specified information. The
[5049] Fix | Delete
* first character is provided and the rest is read by the function to determine
[5050] Fix | Delete
* the correct token to create.
[5051] Fix | Delete
* @param {String} first The first character in the identifier.
[5052] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5053] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5054] Fix | Delete
* @return {Object} A token object.
[5055] Fix | Delete
* @method identOrFunctionToken
[5056] Fix | Delete
*/
[5057] Fix | Delete
identOrFunctionToken: function(first, startLine, startCol) {
[5058] Fix | Delete
var reader = this._reader,
[5059] Fix | Delete
ident = this.readName(first),
[5060] Fix | Delete
tt = Tokens.IDENT,
[5061] Fix | Delete
uriFns = ["url(", "url-prefix(", "domain("],
[5062] Fix | Delete
uri;
[5063] Fix | Delete
[5064] Fix | Delete
//if there's a left paren immediately after, it's a URI or function
[5065] Fix | Delete
if (reader.peek() === "(") {
[5066] Fix | Delete
ident += reader.read();
[5067] Fix | Delete
if (uriFns.indexOf(ident.toLowerCase()) > -1) {
[5068] Fix | Delete
reader.mark();
[5069] Fix | Delete
uri = this.readURI(ident);
[5070] Fix | Delete
if (uri === null) {
[5071] Fix | Delete
//didn't find a valid URL or there's no closing paren
[5072] Fix | Delete
reader.reset();
[5073] Fix | Delete
tt = Tokens.FUNCTION;
[5074] Fix | Delete
} else {
[5075] Fix | Delete
tt = Tokens.URI;
[5076] Fix | Delete
ident = uri;
[5077] Fix | Delete
}
[5078] Fix | Delete
} else {
[5079] Fix | Delete
tt = Tokens.FUNCTION;
[5080] Fix | Delete
}
[5081] Fix | Delete
} else if (reader.peek() === ":") { //might be an IE function
[5082] Fix | Delete
[5083] Fix | Delete
//IE-specific functions always being with progid:
[5084] Fix | Delete
if (ident.toLowerCase() === "progid") {
[5085] Fix | Delete
ident += reader.readTo("(");
[5086] Fix | Delete
tt = Tokens.IE_FUNCTION;
[5087] Fix | Delete
}
[5088] Fix | Delete
}
[5089] Fix | Delete
[5090] Fix | Delete
return this.createToken(tt, ident, startLine, startCol);
[5091] Fix | Delete
},
[5092] Fix | Delete
[5093] Fix | Delete
/**
[5094] Fix | Delete
* Produces an IMPORTANT_SYM or CHAR token based on the specified information. The
[5095] Fix | Delete
* first character is provided and the rest is read by the function to determine
[5096] Fix | Delete
* the correct token to create.
[5097] Fix | Delete
* @param {String} first The first character in the token.
[5098] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5099] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5100] Fix | Delete
* @return {Object} A token object.
[5101] Fix | Delete
* @method importantToken
[5102] Fix | Delete
*/
[5103] Fix | Delete
importantToken: function(first, startLine, startCol) {
[5104] Fix | Delete
var reader = this._reader,
[5105] Fix | Delete
important = first,
[5106] Fix | Delete
tt = Tokens.CHAR,
[5107] Fix | Delete
temp,
[5108] Fix | Delete
c;
[5109] Fix | Delete
[5110] Fix | Delete
reader.mark();
[5111] Fix | Delete
c = reader.read();
[5112] Fix | Delete
[5113] Fix | Delete
while (c) {
[5114] Fix | Delete
[5115] Fix | Delete
//there can be a comment in here
[5116] Fix | Delete
if (c === "/") {
[5117] Fix | Delete
[5118] Fix | Delete
//if the next character isn't a star, then this isn't a valid !important token
[5119] Fix | Delete
if (reader.peek() !== "*") {
[5120] Fix | Delete
break;
[5121] Fix | Delete
} else {
[5122] Fix | Delete
temp = this.readComment(c);
[5123] Fix | Delete
if (temp === "") { //broken!
[5124] Fix | Delete
break;
[5125] Fix | Delete
}
[5126] Fix | Delete
}
[5127] Fix | Delete
} else if (isWhitespace(c)) {
[5128] Fix | Delete
important += c + this.readWhitespace();
[5129] Fix | Delete
} else if (/i/i.test(c)) {
[5130] Fix | Delete
temp = reader.readCount(8);
[5131] Fix | Delete
if (/mportant/i.test(temp)) {
[5132] Fix | Delete
important += c + temp;
[5133] Fix | Delete
tt = Tokens.IMPORTANT_SYM;
[5134] Fix | Delete
[5135] Fix | Delete
}
[5136] Fix | Delete
break; //we're done
[5137] Fix | Delete
} else {
[5138] Fix | Delete
break;
[5139] Fix | Delete
}
[5140] Fix | Delete
[5141] Fix | Delete
c = reader.read();
[5142] Fix | Delete
}
[5143] Fix | Delete
[5144] Fix | Delete
if (tt === Tokens.CHAR) {
[5145] Fix | Delete
reader.reset();
[5146] Fix | Delete
return this.charToken(first, startLine, startCol);
[5147] Fix | Delete
} else {
[5148] Fix | Delete
return this.createToken(tt, important, startLine, startCol);
[5149] Fix | Delete
}
[5150] Fix | Delete
[5151] Fix | Delete
[5152] Fix | Delete
},
[5153] Fix | Delete
[5154] Fix | Delete
/**
[5155] Fix | Delete
* Produces a NOT or CHAR token based on the specified information. The
[5156] Fix | Delete
* first character is provided and the rest is read by the function to determine
[5157] Fix | Delete
* the correct token to create.
[5158] Fix | Delete
* @param {String} first The first character in the token.
[5159] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5160] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5161] Fix | Delete
* @return {Object} A token object.
[5162] Fix | Delete
* @method notToken
[5163] Fix | Delete
*/
[5164] Fix | Delete
notToken: function(first, startLine, startCol) {
[5165] Fix | Delete
var reader = this._reader,
[5166] Fix | Delete
text = first;
[5167] Fix | Delete
[5168] Fix | Delete
reader.mark();
[5169] Fix | Delete
text += reader.readCount(4);
[5170] Fix | Delete
[5171] Fix | Delete
if (text.toLowerCase() === ":not(") {
[5172] Fix | Delete
return this.createToken(Tokens.NOT, text, startLine, startCol);
[5173] Fix | Delete
} else {
[5174] Fix | Delete
reader.reset();
[5175] Fix | Delete
return this.charToken(first, startLine, startCol);
[5176] Fix | Delete
}
[5177] Fix | Delete
},
[5178] Fix | Delete
[5179] Fix | Delete
/**
[5180] Fix | Delete
* Produces a number token based on the given character
[5181] Fix | Delete
* and location in the stream. This may return a token of
[5182] Fix | Delete
* NUMBER, EMS, EXS, LENGTH, ANGLE, TIME, FREQ, DIMENSION,
[5183] Fix | Delete
* or PERCENTAGE.
[5184] Fix | Delete
* @param {String} first The first character for the token.
[5185] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5186] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5187] Fix | Delete
* @return {Object} A token object.
[5188] Fix | Delete
* @method numberToken
[5189] Fix | Delete
*/
[5190] Fix | Delete
numberToken: function(first, startLine, startCol) {
[5191] Fix | Delete
var reader = this._reader,
[5192] Fix | Delete
value = this.readNumber(first),
[5193] Fix | Delete
ident,
[5194] Fix | Delete
tt = Tokens.NUMBER,
[5195] Fix | Delete
c = reader.peek();
[5196] Fix | Delete
[5197] Fix | Delete
if (isIdentStart(c)) {
[5198] Fix | Delete
ident = this.readName(reader.read());
[5199] Fix | Delete
value += ident;
[5200] Fix | Delete
[5201] Fix | Delete
if (/^em$|^ex$|^px$|^gd$|^rem$|^vw$|^vh$|^vmax$|^vmin$|^ch$|^cm$|^mm$|^in$|^pt$|^pc$/i.test(ident)) {
[5202] Fix | Delete
tt = Tokens.LENGTH;
[5203] Fix | Delete
} else if (/^deg|^rad$|^grad$|^turn$/i.test(ident)) {
[5204] Fix | Delete
tt = Tokens.ANGLE;
[5205] Fix | Delete
} else if (/^ms$|^s$/i.test(ident)) {
[5206] Fix | Delete
tt = Tokens.TIME;
[5207] Fix | Delete
} else if (/^hz$|^khz$/i.test(ident)) {
[5208] Fix | Delete
tt = Tokens.FREQ;
[5209] Fix | Delete
} else if (/^dpi$|^dpcm$/i.test(ident)) {
[5210] Fix | Delete
tt = Tokens.RESOLUTION;
[5211] Fix | Delete
} else {
[5212] Fix | Delete
tt = Tokens.DIMENSION;
[5213] Fix | Delete
}
[5214] Fix | Delete
[5215] Fix | Delete
} else if (c === "%") {
[5216] Fix | Delete
value += reader.read();
[5217] Fix | Delete
tt = Tokens.PERCENTAGE;
[5218] Fix | Delete
}
[5219] Fix | Delete
[5220] Fix | Delete
return this.createToken(tt, value, startLine, startCol);
[5221] Fix | Delete
},
[5222] Fix | Delete
[5223] Fix | Delete
/**
[5224] Fix | Delete
* Produces a string token based on the given character
[5225] Fix | Delete
* and location in the stream. Since strings may be indicated
[5226] Fix | Delete
* by single or double quotes, a failure to match starting
[5227] Fix | Delete
* and ending quotes results in an INVALID token being generated.
[5228] Fix | Delete
* The first character in the string is passed in and then
[5229] Fix | Delete
* the rest are read up to and including the final quotation mark.
[5230] Fix | Delete
* @param {String} first The first character in the string.
[5231] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5232] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5233] Fix | Delete
* @return {Object} A token object.
[5234] Fix | Delete
* @method stringToken
[5235] Fix | Delete
*/
[5236] Fix | Delete
stringToken: function(first, startLine, startCol) {
[5237] Fix | Delete
var delim = first,
[5238] Fix | Delete
string = first,
[5239] Fix | Delete
reader = this._reader,
[5240] Fix | Delete
tt = Tokens.STRING,
[5241] Fix | Delete
c = reader.read(),
[5242] Fix | Delete
i;
[5243] Fix | Delete
[5244] Fix | Delete
while (c) {
[5245] Fix | Delete
string += c;
[5246] Fix | Delete
[5247] Fix | Delete
if (c === "\\") {
[5248] Fix | Delete
c = reader.read();
[5249] Fix | Delete
if (c === null) {
[5250] Fix | Delete
break; // premature EOF after backslash
[5251] Fix | Delete
} else if (/[^\r\n\f0-9a-f]/i.test(c)) {
[5252] Fix | Delete
// single-character escape
[5253] Fix | Delete
string += c;
[5254] Fix | Delete
} else {
[5255] Fix | Delete
// read up to six hex digits
[5256] Fix | Delete
for (i=0; isHexDigit(c) && i<6; i++) {
[5257] Fix | Delete
string += c;
[5258] Fix | Delete
c = reader.read();
[5259] Fix | Delete
}
[5260] Fix | Delete
// swallow trailing newline or space
[5261] Fix | Delete
if (c === "\r" && reader.peek() === "\n") {
[5262] Fix | Delete
string += c;
[5263] Fix | Delete
c = reader.read();
[5264] Fix | Delete
}
[5265] Fix | Delete
if (isWhitespace(c)) {
[5266] Fix | Delete
string += c;
[5267] Fix | Delete
} else {
[5268] Fix | Delete
// This character is null or not part of the escape;
[5269] Fix | Delete
// jump back to the top to process it.
[5270] Fix | Delete
continue;
[5271] Fix | Delete
}
[5272] Fix | Delete
}
[5273] Fix | Delete
} else if (c === delim) {
[5274] Fix | Delete
break; // delimiter found.
[5275] Fix | Delete
} else if (isNewLine(reader.peek())) {
[5276] Fix | Delete
// newline without an escapement: it's an invalid string
[5277] Fix | Delete
tt = Tokens.INVALID;
[5278] Fix | Delete
break;
[5279] Fix | Delete
}
[5280] Fix | Delete
c = reader.read();
[5281] Fix | Delete
}
[5282] Fix | Delete
[5283] Fix | Delete
//if c is null, that means we're out of input and the string was never closed
[5284] Fix | Delete
if (c === null) {
[5285] Fix | Delete
tt = Tokens.INVALID;
[5286] Fix | Delete
}
[5287] Fix | Delete
[5288] Fix | Delete
return this.createToken(tt, string, startLine, startCol);
[5289] Fix | Delete
},
[5290] Fix | Delete
[5291] Fix | Delete
unicodeRangeToken: function(first, startLine, startCol) {
[5292] Fix | Delete
var reader = this._reader,
[5293] Fix | Delete
value = first,
[5294] Fix | Delete
temp,
[5295] Fix | Delete
tt = Tokens.CHAR;
[5296] Fix | Delete
[5297] Fix | Delete
//then it should be a unicode range
[5298] Fix | Delete
if (reader.peek() === "+") {
[5299] Fix | Delete
reader.mark();
[5300] Fix | Delete
value += reader.read();
[5301] Fix | Delete
value += this.readUnicodeRangePart(true);
[5302] Fix | Delete
[5303] Fix | Delete
//ensure there's an actual unicode range here
[5304] Fix | Delete
if (value.length === 2) {
[5305] Fix | Delete
reader.reset();
[5306] Fix | Delete
} else {
[5307] Fix | Delete
[5308] Fix | Delete
tt = Tokens.UNICODE_RANGE;
[5309] Fix | Delete
[5310] Fix | Delete
//if there's a ? in the first part, there can't be a second part
[5311] Fix | Delete
if (value.indexOf("?") === -1) {
[5312] Fix | Delete
[5313] Fix | Delete
if (reader.peek() === "-") {
[5314] Fix | Delete
reader.mark();
[5315] Fix | Delete
temp = reader.read();
[5316] Fix | Delete
temp += this.readUnicodeRangePart(false);
[5317] Fix | Delete
[5318] Fix | Delete
//if there's not another value, back up and just take the first
[5319] Fix | Delete
if (temp.length === 1) {
[5320] Fix | Delete
reader.reset();
[5321] Fix | Delete
} else {
[5322] Fix | Delete
value += temp;
[5323] Fix | Delete
}
[5324] Fix | Delete
}
[5325] Fix | Delete
[5326] Fix | Delete
}
[5327] Fix | Delete
}
[5328] Fix | Delete
}
[5329] Fix | Delete
[5330] Fix | Delete
return this.createToken(tt, value, startLine, startCol);
[5331] Fix | Delete
},
[5332] Fix | Delete
[5333] Fix | Delete
/**
[5334] Fix | Delete
* Produces a S token based on the specified information. Since whitespace
[5335] Fix | Delete
* may have multiple characters, this consumes all whitespace characters
[5336] Fix | Delete
* into a single token.
[5337] Fix | Delete
* @param {String} first The first character in the token.
[5338] Fix | Delete
* @param {int} startLine The beginning line for the character.
[5339] Fix | Delete
* @param {int} startCol The beginning column for the character.
[5340] Fix | Delete
* @return {Object} A token object.
[5341] Fix | Delete
* @method whitespaceToken
[5342] Fix | Delete
*/
[5343] Fix | Delete
whitespaceToken: function(first, startLine, startCol) {
[5344] Fix | Delete
var value = first + this.readWhitespace();
[5345] Fix | Delete
return this.createToken(Tokens.S, value, startLine, startCol);
[5346] Fix | Delete
},
[5347] Fix | Delete
[5348] Fix | Delete
[5349] Fix | Delete
//-------------------------------------------------------------------------
[5350] Fix | Delete
// Methods to read values from the string stream
[5351] Fix | Delete
//-------------------------------------------------------------------------
[5352] Fix | Delete
[5353] Fix | Delete
readUnicodeRangePart: function(allowQuestionMark) {
[5354] Fix | Delete
var reader = this._reader,
[5355] Fix | Delete
part = "",
[5356] Fix | Delete
c = reader.peek();
[5357] Fix | Delete
[5358] Fix | Delete
//first read hex digits
[5359] Fix | Delete
while (isHexDigit(c) && part.length < 6) {
[5360] Fix | Delete
reader.read();
[5361] Fix | Delete
part += c;
[5362] Fix | Delete
c = reader.peek();
[5363] Fix | Delete
}
[5364] Fix | Delete
[5365] Fix | Delete
//then read question marks if allowed
[5366] Fix | Delete
if (allowQuestionMark) {
[5367] Fix | Delete
while (c === "?" && part.length < 6) {
[5368] Fix | Delete
reader.read();
[5369] Fix | Delete
part += c;
[5370] Fix | Delete
c = reader.peek();
[5371] Fix | Delete
}
[5372] Fix | Delete
}
[5373] Fix | Delete
[5374] Fix | Delete
//there can't be any other characters after this point
[5375] Fix | Delete
[5376] Fix | Delete
return part;
[5377] Fix | Delete
},
[5378] Fix | Delete
[5379] Fix | Delete
readWhitespace: function() {
[5380] Fix | Delete
var reader = this._reader,
[5381] Fix | Delete
whitespace = "",
[5382] Fix | Delete
c = reader.peek();
[5383] Fix | Delete
[5384] Fix | Delete
while (isWhitespace(c)) {
[5385] Fix | Delete
reader.read();
[5386] Fix | Delete
whitespace += c;
[5387] Fix | Delete
c = reader.peek();
[5388] Fix | Delete
}
[5389] Fix | Delete
[5390] Fix | Delete
return whitespace;
[5391] Fix | Delete
},
[5392] Fix | Delete
readNumber: function(first) {
[5393] Fix | Delete
var reader = this._reader,
[5394] Fix | Delete
number = first,
[5395] Fix | Delete
hasDot = (first === "."),
[5396] Fix | Delete
c = reader.peek();
[5397] Fix | Delete
[5398] Fix | Delete
[5399] Fix | Delete
while (c) {
[5400] Fix | Delete
if (isDigit(c)) {
[5401] Fix | Delete
number += reader.read();
[5402] Fix | Delete
} else if (c === ".") {
[5403] Fix | Delete
if (hasDot) {
[5404] Fix | Delete
break;
[5405] Fix | Delete
} else {
[5406] Fix | Delete
hasDot = true;
[5407] Fix | Delete
number += reader.read();
[5408] Fix | Delete
}
[5409] Fix | Delete
} else {
[5410] Fix | Delete
break;
[5411] Fix | Delete
}
[5412] Fix | Delete
[5413] Fix | Delete
c = reader.peek();
[5414] Fix | Delete
}
[5415] Fix | Delete
[5416] Fix | Delete
return number;
[5417] Fix | Delete
},
[5418] Fix | Delete
[5419] Fix | Delete
// returns null w/o resetting reader if string is invalid.
[5420] Fix | Delete
readString: function() {
[5421] Fix | Delete
var token = this.stringToken(this._reader.read(), 0, 0);
[5422] Fix | Delete
return token.type === Tokens.INVALID ? null : token.value;
[5423] Fix | Delete
},
[5424] Fix | Delete
[5425] Fix | Delete
// returns null w/o resetting reader if URI is invalid.
[5426] Fix | Delete
readURI: function(first) {
[5427] Fix | Delete
var reader = this._reader,
[5428] Fix | Delete
uri = first,
[5429] Fix | Delete
inner = "",
[5430] Fix | Delete
c = reader.peek();
[5431] Fix | Delete
[5432] Fix | Delete
//skip whitespace before
[5433] Fix | Delete
while (c && isWhitespace(c)) {
[5434] Fix | Delete
reader.read();
[5435] Fix | Delete
c = reader.peek();
[5436] Fix | Delete
}
[5437] Fix | Delete
[5438] Fix | Delete
//it's a string
[5439] Fix | Delete
if (c === "'" || c === "\"") {
[5440] Fix | Delete
inner = this.readString();
[5441] Fix | Delete
if (inner !== null) {
[5442] Fix | Delete
inner = PropertyValuePart.parseString(inner);
[5443] Fix | Delete
}
[5444] Fix | Delete
} else {
[5445] Fix | Delete
inner = this.readUnquotedURL();
[5446] Fix | Delete
}
[5447] Fix | Delete
[5448] Fix | Delete
c = reader.peek();
[5449] Fix | Delete
[5450] Fix | Delete
//skip whitespace after
[5451] Fix | Delete
while (c && isWhitespace(c)) {
[5452] Fix | Delete
reader.read();
[5453] Fix | Delete
c = reader.peek();
[5454] Fix | Delete
}
[5455] Fix | Delete
[5456] Fix | Delete
//if there was no inner value or the next character isn't closing paren, it's not a URI
[5457] Fix | Delete
if (inner === null || c !== ")") {
[5458] Fix | Delete
uri = null;
[5459] Fix | Delete
} else {
[5460] Fix | Delete
// Ensure argument to URL is always double-quoted
[5461] Fix | Delete
// (This simplifies later processing in PropertyValuePart.)
[5462] Fix | Delete
uri += PropertyValuePart.serializeString(inner) + reader.read();
[5463] Fix | Delete
}
[5464] Fix | Delete
[5465] Fix | Delete
return uri;
[5466] Fix | Delete
},
[5467] Fix | Delete
// This method never fails, although it may return an empty string.
[5468] Fix | Delete
readUnquotedURL: function(first) {
[5469] Fix | Delete
var reader = this._reader,
[5470] Fix | Delete
url = first || "",
[5471] Fix | Delete
c;
[5472] Fix | Delete
[5473] Fix | Delete
for (c = reader.peek(); c; c = reader.peek()) {
[5474] Fix | Delete
// Note that the grammar at
[5475] Fix | Delete
// https://www.w3.org/TR/CSS2/grammar.html#scanner
[5476] Fix | Delete
// incorrectly includes the backslash character in the
[5477] Fix | Delete
// `url` production, although it is correctly omitted in
[5478] Fix | Delete
// the `baduri1` production.
[5479] Fix | Delete
if (nonascii.test(c) || /^[\-!#$%&*-\[\]-~]$/.test(c)) {
[5480] Fix | Delete
url += c;
[5481] Fix | Delete
reader.read();
[5482] Fix | Delete
} else if (c === "\\") {
[5483] Fix | Delete
if (/^[^\r\n\f]$/.test(reader.peek(2))) {
[5484] Fix | Delete
url += this.readEscape(reader.read(), true);
[5485] Fix | Delete
} else {
[5486] Fix | Delete
break; // bad escape sequence.
[5487] Fix | Delete
}
[5488] Fix | Delete
} else {
[5489] Fix | Delete
break; // bad character
[5490] Fix | Delete
}
[5491] Fix | Delete
}
[5492] Fix | Delete
[5493] Fix | Delete
return url;
[5494] Fix | Delete
},
[5495] Fix | Delete
[5496] Fix | Delete
readName: function(first) {
[5497] Fix | Delete
var reader = this._reader,
[5498] Fix | Delete
ident = first || "",
[5499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function