chrome-devtools-frontend 1.0.1024644 → 1.0.1025175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/sdk/SourceMap.ts +41 -4
 - package/front_end/models/text_utils/TextRange.ts +6 -0
 - package/front_end/panels/performance_monitor/performanceMonitor.css +1 -4
 - package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -0
 - package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -1
 - package/front_end/ui/legacy/themeColors.css +2 -2
 - package/package.json +1 -1
 
| 
         @@ -88,6 +88,8 @@ export class SourceMapV3 { 
     | 
|
| 
       88 
88 
     | 
    
         
             
              sourceRoot!: Platform.DevToolsPath.UrlString|undefined;
         
     | 
| 
       89 
89 
     | 
    
         
             
              names!: string[]|undefined;
         
     | 
| 
       90 
90 
     | 
    
         
             
              sourcesContent!: string|undefined;
         
     | 
| 
      
 91 
     | 
    
         
            +
              // eslint-disable-next-line @typescript-eslint/naming-convention
         
     | 
| 
      
 92 
     | 
    
         
            +
              x_google_ignoreList!: number[]|undefined;
         
     | 
| 
       91 
93 
     | 
    
         
             
              constructor() {
         
     | 
| 
       92 
94 
     | 
    
         
             
              }
         
     | 
| 
       93 
95 
     | 
    
         
             
            }
         
     | 
| 
         @@ -432,6 +434,7 @@ export class TextSourceMap implements SourceMap { 
     | 
|
| 
       432 
434 
     | 
    
         
             
              private parseSources(sourceMap: SourceMapV3): void {
         
     | 
| 
       433 
435 
     | 
    
         
             
                const sourcesList = [];
         
     | 
| 
       434 
436 
     | 
    
         
             
                const sourceRoot = sourceMap.sourceRoot || Platform.DevToolsPath.EmptyUrlString;
         
     | 
| 
      
 437 
     | 
    
         
            +
                const ignoreList = new Set(sourceMap.x_google_ignoreList);
         
     | 
| 
       435 
438 
     | 
    
         
             
                for (let i = 0; i < sourceMap.sources.length; ++i) {
         
     | 
| 
       436 
439 
     | 
    
         
             
                  let href = sourceMap.sources[i];
         
     | 
| 
       437 
440 
     | 
    
         
             
                  // The source map v3 proposal says to prepend the sourceRoot to the source URL
         
     | 
| 
         @@ -453,7 +456,9 @@ export class TextSourceMap implements SourceMap { 
     | 
|
| 
       453 
456 
     | 
    
         
             
                  }
         
     | 
| 
       454 
457 
     | 
    
         
             
                  sourcesList.push(url);
         
     | 
| 
       455 
458 
     | 
    
         
             
                  if (!this.#sourceInfos.has(url)) {
         
     | 
| 
       456 
     | 
    
         
            -
                     
     | 
| 
      
 459 
     | 
    
         
            +
                    const content = source ?? null;
         
     | 
| 
      
 460 
     | 
    
         
            +
                    const ignoreListHint = ignoreList.has(i);
         
     | 
| 
      
 461 
     | 
    
         
            +
                    this.#sourceInfos.set(url, new TextSourceMap.SourceInfo(content, ignoreListHint));
         
     | 
| 
       457 
462 
     | 
    
         
             
                  }
         
     | 
| 
       458 
463 
     | 
    
         
             
                }
         
     | 
| 
       459 
464 
     | 
    
         
             
                sourceMapToSourceList.set(sourceMap, sourcesList);
         
     | 
| 
         @@ -584,6 +589,40 @@ export class TextSourceMap implements SourceMap { 
     | 
|
| 
       584 
589 
     | 
    
         
             
                }
         
     | 
| 
       585 
590 
     | 
    
         
             
                return false;
         
     | 
| 
       586 
591 
     | 
    
         
             
              }
         
     | 
| 
      
 592 
     | 
    
         
            +
             
     | 
| 
      
 593 
     | 
    
         
            +
              hasIgnoreListHint(sourceURL: Platform.DevToolsPath.UrlString): boolean {
         
     | 
| 
      
 594 
     | 
    
         
            +
                return this.#sourceInfos.get(sourceURL)?.ignoreListHint ?? false;
         
     | 
| 
      
 595 
     | 
    
         
            +
              }
         
     | 
| 
      
 596 
     | 
    
         
            +
             
     | 
| 
      
 597 
     | 
    
         
            +
              /**
         
     | 
| 
      
 598 
     | 
    
         
            +
               * Returns a list of ranges in the generated script, which are known to be
         
     | 
| 
      
 599 
     | 
    
         
            +
               * third-party code that should be ignore-listed. Each range is a [begin, end)
         
     | 
| 
      
 600 
     | 
    
         
            +
               * pair, meaning that code at the beginning location, up to but not including
         
     | 
| 
      
 601 
     | 
    
         
            +
               * the end location, is known to be third-party code.
         
     | 
| 
      
 602 
     | 
    
         
            +
               */
         
     | 
| 
      
 603 
     | 
    
         
            +
              ignoreListRanges(): TextUtils.TextRange.TextRange[] {
         
     | 
| 
      
 604 
     | 
    
         
            +
                const mappings = this.mappings();
         
     | 
| 
      
 605 
     | 
    
         
            +
                const ranges = [];
         
     | 
| 
      
 606 
     | 
    
         
            +
             
     | 
| 
      
 607 
     | 
    
         
            +
                let current: TextUtils.TextRange.TextRange|null = null;
         
     | 
| 
      
 608 
     | 
    
         
            +
             
     | 
| 
      
 609 
     | 
    
         
            +
                for (const {sourceURL, lineNumber, columnNumber} of mappings) {
         
     | 
| 
      
 610 
     | 
    
         
            +
                  const ignoreListHint = sourceURL && this.hasIgnoreListHint(sourceURL);
         
     | 
| 
      
 611 
     | 
    
         
            +
             
     | 
| 
      
 612 
     | 
    
         
            +
                  if (!current && ignoreListHint) {
         
     | 
| 
      
 613 
     | 
    
         
            +
                    current = TextUtils.TextRange.TextRange.createUnboundedFromLocation(lineNumber, columnNumber);
         
     | 
| 
      
 614 
     | 
    
         
            +
                    ranges.push(current);
         
     | 
| 
      
 615 
     | 
    
         
            +
                    continue;
         
     | 
| 
      
 616 
     | 
    
         
            +
                  }
         
     | 
| 
      
 617 
     | 
    
         
            +
                  if (current && !ignoreListHint) {
         
     | 
| 
      
 618 
     | 
    
         
            +
                    current.endLine = lineNumber;
         
     | 
| 
      
 619 
     | 
    
         
            +
                    current.endColumn = columnNumber;
         
     | 
| 
      
 620 
     | 
    
         
            +
                    current = null;
         
     | 
| 
      
 621 
     | 
    
         
            +
                  }
         
     | 
| 
      
 622 
     | 
    
         
            +
                }
         
     | 
| 
      
 623 
     | 
    
         
            +
             
     | 
| 
      
 624 
     | 
    
         
            +
                return ranges;
         
     | 
| 
      
 625 
     | 
    
         
            +
              }
         
     | 
| 
       587 
626 
     | 
    
         
             
            }
         
     | 
| 
       588 
627 
     | 
    
         | 
| 
       589 
628 
     | 
    
         
             
            export namespace TextSourceMap {
         
     | 
| 
         @@ -620,11 +659,9 @@ export namespace TextSourceMap { 
     | 
|
| 
       620 
659 
     | 
    
         
             
              }
         
     | 
| 
       621 
660 
     | 
    
         | 
| 
       622 
661 
     | 
    
         
             
              export class SourceInfo {
         
     | 
| 
       623 
     | 
    
         
            -
                content: string|null;
         
     | 
| 
       624 
662 
     | 
    
         
             
                reverseMappings: number[]|null = null;
         
     | 
| 
       625 
663 
     | 
    
         | 
| 
       626 
     | 
    
         
            -
                constructor(content: string|null) {
         
     | 
| 
       627 
     | 
    
         
            -
                  this.content = content;
         
     | 
| 
      
 664 
     | 
    
         
            +
                constructor(public content: string|null, public ignoreListHint: boolean) {
         
     | 
| 
       628 
665 
     | 
    
         
             
                }
         
     | 
| 
       629 
666 
     | 
    
         
             
              }
         
     | 
| 
       630 
667 
     | 
    
         
             
            }
         
     | 
| 
         @@ -30,6 +30,8 @@ 
     | 
|
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
            import * as Platform from '../../core/platform/platform.js';
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
      
 33 
     | 
    
         
            +
            const MAX_SAFE_INT32 = 2 ** 31 - 1;
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
       33 
35 
     | 
    
         
             
            export interface SerializedTextRange {
         
     | 
| 
       34 
36 
     | 
    
         
             
              startLine: number;
         
     | 
| 
       35 
37 
     | 
    
         
             
              startColumn: number;
         
     | 
| 
         @@ -45,6 +47,10 @@ export class TextRange { 
     | 
|
| 
       45 
47 
     | 
    
         
             
                return new TextRange(line, column, line, column);
         
     | 
| 
       46 
48 
     | 
    
         
             
              }
         
     | 
| 
       47 
49 
     | 
    
         | 
| 
      
 50 
     | 
    
         
            +
              static createUnboundedFromLocation(line: number, column: number): TextRange {
         
     | 
| 
      
 51 
     | 
    
         
            +
                return new TextRange(line, column, MAX_SAFE_INT32, MAX_SAFE_INT32);
         
     | 
| 
      
 52 
     | 
    
         
            +
              }
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       48 
54 
     | 
    
         
             
              static fromObject(serializedTextRange: SerializedTextRange): TextRange {
         
     | 
| 
       49 
55 
     | 
    
         
             
                return new TextRange(
         
     | 
| 
       50 
56 
     | 
    
         
             
                    serializedTextRange.startLine, serializedTextRange.startColumn, serializedTextRange.endLine,
         
     | 
| 
         @@ -231,7 +231,7 @@ 
     | 
|
| 
       231 
231 
     | 
    
         
             
              --color-syntax-3: rgb(242 151 102);
         
     | 
| 
       232 
232 
     | 
    
         
             
              --color-syntax-4: rgb(155 187 220);
         
     | 
| 
       233 
233 
     | 
    
         
             
              --color-syntax-5: rgb(132 240 255);
         
     | 
| 
       234 
     | 
    
         
            -
              --color-syntax-6: rgb( 
     | 
| 
      
 234 
     | 
    
         
            +
              --color-syntax-6: rgb(171 171 171);
         
     | 
| 
       235 
235 
     | 
    
         
             
              --color-syntax-7: rgb(207 208 208);
         
     | 
| 
       236 
236 
     | 
    
         
             
              --color-syntax-8: rgb(93 176 215);
         
     | 
| 
       237 
237 
     | 
    
         
             
              --drop-shadow:
         
     | 
| 
         @@ -301,7 +301,7 @@ 
     | 
|
| 
       301 
301 
     | 
    
         
             
              --color-token-string-special: var(--color-token-string);
         
     | 
| 
       302 
302 
     | 
    
         
             
              --color-token-atom: rgb(161 247 181);
         
     | 
| 
       303 
303 
     | 
    
         
             
              --color-token-number: var(--color-token-atom);
         
     | 
| 
       304 
     | 
    
         
            -
              --color-token-comment:  
     | 
| 
      
 304 
     | 
    
         
            +
              --color-token-comment: var(--color-syntax-6);
         
     | 
| 
       305 
305 
     | 
    
         
             
              --color-token-tag: rgb(93 176 215);
         
     | 
| 
       306 
306 
     | 
    
         
             
              --color-token-attribute: rgb(155 187 220);
         
     | 
| 
       307 
307 
     | 
    
         
             
              --color-token-attribute-value: rgb(242 151 102);
         
     | 
    
        package/package.json
    CHANGED