Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
| 5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 585 if (areNodesSimilar(node, siblings[i])) { | 585 if (areNodesSimilar(node, siblings[i])) { |
| 586 if (siblings[i] === node) | 586 if (siblings[i] === node) |
| 587 return ownIndex; | 587 return ownIndex; |
| 588 ++ownIndex; | 588 ++ownIndex; |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 return -1; // An error occurred: |node| not found in parent's children. | 591 return -1; // An error occurred: |node| not found in parent's children. |
| 592 }; | 592 }; |
| 593 | 593 |
| 594 /** | 594 /** |
| 595 * @param {string} truncatedText | |
| 596 * @param {string} originalText | |
| 597 * @return {!Text} | |
| 598 */ | |
| 599 Components.DOMPresentationUtils.createTruncatedTextNode = function(truncatedText , originalText) { | |
| 600 var node = createTextNode(truncatedText); | |
| 601 node[Components.DOMPresentationUtils._untruncatedTextSymbol] = originalText; | |
|
dgozman
2017/04/05 15:45:13
This is only used for Console, let's put it there.
luoe
2017/04/06 02:10:24
I've returned to the approach in patch set 3 where
| |
| 602 return node; | |
| 603 }; | |
| 604 | |
| 605 /** | |
| 606 * @param {!Node} node | |
| 607 * @return {string} | |
| 608 */ | |
| 609 Components.DOMPresentationUtils.originalNodeText = function(node) { | |
| 610 if (typeof node[Components.DOMPresentationUtils._untruncatedTextSymbol] === 's tring') | |
| 611 return node[Components.DOMPresentationUtils._untruncatedTextSymbol]; | |
| 612 return node.textContent; | |
| 613 }; | |
| 614 | |
| 615 /** | |
| 595 * @unrestricted | 616 * @unrestricted |
| 596 */ | 617 */ |
| 597 Components.DOMNodePathStep = class { | 618 Components.DOMNodePathStep = class { |
| 598 /** | 619 /** |
| 599 * @param {string} value | 620 * @param {string} value |
| 600 * @param {boolean} optimized | 621 * @param {boolean} optimized |
| 601 */ | 622 */ |
| 602 constructor(value, optimized) { | 623 constructor(value, optimized) { |
| 603 this.value = value; | 624 this.value = value; |
| 604 this.optimized = optimized || false; | 625 this.optimized = optimized || false; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 641 | 662 |
| 642 /** | 663 /** |
| 643 * @override | 664 * @override |
| 644 * @param {!SDK.DOMNode} node | 665 * @param {!SDK.DOMNode} node |
| 645 * @return {?{title: string, color: string}} | 666 * @return {?{title: string, color: string}} |
| 646 */ | 667 */ |
| 647 decorate(node) { | 668 decorate(node) { |
| 648 return {title: this._title, color: this._color}; | 669 return {title: this._title, color: this._color}; |
| 649 } | 670 } |
| 650 }; | 671 }; |
| 672 | |
| 673 /** | |
| 674 * @type {symbol} | |
| 675 * @const | |
| 676 */ | |
| 677 Components.DOMPresentationUtils._untruncatedTextSymbol = Symbol('UntruncatedText Symbol'); | |
| OLD | NEW |