Bug 1418874 part 1 - Use JS impl of CSS lexer instead of that from InspectorUtils in devtools. r=tromey

MozReview-Commit-ID: 3mam0A2JNif

--HG--
extra : rebase_source : a4d6af4bbd063875903f9d37c221b0fb1fbf0ece
This commit is contained in:
Xidorn Quan 2018-06-14 18:02:02 -07:00
Родитель 2a805620a7
Коммит 93f4492e83
2 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -6,15 +6,15 @@
// Tests that the Filter Editor Widget parses filter values correctly (setCssValue)
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const InspectorUtils = require("InspectorUtils");
const TEST_URI = CHROME_URL_ROOT + "doc_filter-editor-01.html";
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const {getCSSLexer} = require("devtools/shared/css/lexer");
// Verify that the given string consists of a valid CSS URL token.
// Return true on success, false on error.
function verifyURL(string) {
const lexer = InspectorUtils.getCSSLexer(string);
const lexer = getCSSLexer(string);
const token = lexer.nextToken();
if (!token || token.tokenType !== "url") {

Просмотреть файл

@ -6,6 +6,7 @@
const Services = require("Services");
const protocol = require("devtools/shared/protocol");
const {getCSSLexer} = require("devtools/shared/css/lexer");
const {LongStringActor} = require("devtools/server/actors/string");
const InspectorUtils = require("InspectorUtils");
@ -1611,7 +1612,7 @@ function getRuleText(initialText, line, column) {
const {offset: textOffset, text} =
getTextAtLineColumn(initialText, line, column);
const lexer = InspectorUtils.getCSSLexer(text);
const lexer = getCSSLexer(text);
// Search forward for the opening brace.
while (true) {
@ -1685,7 +1686,7 @@ function getSelectorOffsets(initialText, line, column) {
const {offset: textOffset, text} =
getTextAtLineColumn(initialText, line, column);
const lexer = InspectorUtils.getCSSLexer(text);
const lexer = getCSSLexer(text);
// Search forward for the opening brace.
let endOffset;