Markup view not working on elements containing a 'constructor' attribute
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: bgrins, Assigned: miker)
References
()
Details
Attachments
(1 file, 1 obsolete file)
When I right click -> Inspect Element on one of the <summary> tags on https://bgrins.github.io/xbl-analysis/tree/, I'm getting mostly-empty markup view along with this error in the Browser Console.
STR:
Right click on the text "basecontrol" and Inspect Element
Expected:
Element is opened in markup view
Actual:
TypeError: ATTRIBUTE_TYPES[attributeName] is not iterable: getType@resource://devtools/client/shared/node-attribute-parser.js:305:1
parseAttribute@resource://devtools/client/shared/node-attribute-parser.js:279:16
_createAttribute@resource://devtools/client/inspector/markup/views/element-editor.js:545:29
update@resource://devtools/client/inspector/markup/views/element-editor.js:260:27
ElementEditor@resource://devtools/client/inspector/markup/views/element-editor.js:133:3
MarkupElementContainer@resource://devtools/client/inspector/markup/views/element-container.js:36:19
importNode@resource://devtools/client/inspector/markup/markup.js:1076:19
_ensureNodeImported@resource://devtools/client/inspector/markup/markup.js:1261:7
showNode@resource://devtools/client/inspector/markup/markup.js:1241:7
_onNewSelection@resource://devtools/client/inspector/markup/markup.js:689:20
emit@resource://devtools/shared/event-emitter.js:186:15
emit@resource://devtools/shared/event-emitter.js:267:5
setNodeFront@resource://devtools/client/framework/selection.js:153:5
inspectNode@resource://devtools/client/framework/devtools.js:706:5
async*inspectNode@chrome://devtools-startup/content/DevToolsShim.jsm:239:12
inspectNode@chrome://browser/content/nsContextMenu.js:767:12
oncommand@chrome://browser/content/browser.xul:1:1
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Assignee | ||
Updated•5 years ago
|
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Assignee | ||
Comment 7•5 years ago
|
||
These are two different issues so I will split the P1 off into a new bug.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 8•5 years ago
|
||
ATTRIBUTE_TYPES
was an object and we used to access it's attributes using e.g.
ATTRIBUTE_TYPES["href"]
, which is fine in almost all cases.
The problem occurred when the attribute name was constructor
. This caused us
to attempt to parse ATTRIBUTE_TYPES["constructor"]
, which returned
{}.constructor
therefore breaking the attribute parser.
Changing ATTRIBUTE_TYPES
to a Map fixes the issue because
ATTRIBUTE_TYPES.get("constructor")
returns null rather than an object
constructor.
Comment 9•5 years ago
|
||
(In reply to Mike Ratcliffe [:miker] [:mratcliffe] [:mikeratcliffe] from comment #8)
The problem occurred when the attribute name was
constructor
. This caused us
to attempt to parseATTRIBUTE_TYPES["constructor"]
, which returned
{}.constructor
therefore breaking the attribute parser.
Ouch! When JavaScript bites back :)
Good catch, though I'm sure this took a while to track down. Thanks for fixing this!
Comment 10•5 years ago
|
||
Pushed by mratcliffe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e9a2417a0425 Markup view not working on elements containing a 'constructor' attribute r=rcaliman
Comment 11•5 years ago
|
||
bugherder |
Description
•