Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js

Issue 2056433002: DevTools: properly format custom elements without nodenames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 573
574 var subtype = this._subtype(obj); 574 var subtype = this._subtype(obj);
575 575
576 if (subtype === "regexp") 576 if (subtype === "regexp")
577 return toString(obj); 577 return toString(obj);
578 578
579 if (subtype === "date") 579 if (subtype === "date")
580 return toString(obj); 580 return toString(obj);
581 581
582 if (subtype === "node") { 582 if (subtype === "node") {
583 var description = obj.nodeName.toLowerCase(); 583 var description = "";
584 if (obj.nodeName)
585 description = obj.nodeName.toLowerCase();
586 else if (obj.constructor)
587 description = obj.constructor.name.toLowerCase();
588
584 switch (obj.nodeType) { 589 switch (obj.nodeType) {
kozy 2016/06/08 20:58:05 What will return obj.nodeType in createCallback fo
luoe 2016/06/09 19:27:44 obj.nodeType will be undefined, in both cases when
585 case 1 /* Node.ELEMENT_NODE */: 590 case 1 /* Node.ELEMENT_NODE */:
586 description += obj.id ? "#" + obj.id : ""; 591 description += obj.id ? "#" + obj.id : "";
587 var className = obj.className; 592 var className = obj.className;
588 description += (className && typeof className === "string") ? ". " + className.trim().replace(/\s+/g, ".") : ""; 593 description += (className && typeof className === "string") ? ". " + className.trim().replace(/\s+/g, ".") : "";
589 break; 594 break;
590 case 10 /*Node.DOCUMENT_TYPE_NODE */: 595 case 10 /*Node.DOCUMENT_TYPE_NODE */:
591 description = "<!DOCTYPE " + description + ">"; 596 description = "<!DOCTYPE " + description + ">";
592 break; 597 break;
593 } 598 }
594 return description; 599 return description;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 return string.substr(0, leftHalf) + "\u2026" + string.substr(string. length - rightHalf, rightHalf); 1006 return string.substr(0, leftHalf) + "\u2026" + string.substr(string. length - rightHalf, rightHalf);
1002 } 1007 }
1003 return string.substr(0, maxLength) + "\u2026"; 1008 return string.substr(0, maxLength) + "\u2026";
1004 }, 1009 },
1005 1010
1006 __proto__: null 1011 __proto__: null
1007 } 1012 }
1008 1013
1009 return injectedScript; 1014 return injectedScript;
1010 }) 1015 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698