mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-09 16:32:39 +01:00
Don't copy null
attributes passed to JX.$N()
Summary: Fixes T8919. In Safari, `node.href = null;` has no effect, but in Chrome it is like `node.href = "null";`. Instead, just use semantics similar to `phutil_tag()`: don't assign attributes with `null` values. Test Plan: No more `/null` href in Chrome in Owners typehaead. Typeahead still works in Chrome/Safari. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8919 Differential Revision: https://secure.phabricator.com/D14021
This commit is contained in:
parent
9159c0e001
commit
fe66d52a22
1 changed files with 7 additions and 1 deletions
8
webroot/rsrc/externals/javelin/lib/DOM.js
vendored
8
webroot/rsrc/externals/javelin/lib/DOM.js
vendored
|
@ -310,7 +310,13 @@ JX.$N = function(tag, attr, content) {
|
|||
}
|
||||
}
|
||||
|
||||
JX.copy(node, attr);
|
||||
for (var k in attr) {
|
||||
if (attr[k] === null) {
|
||||
continue;
|
||||
}
|
||||
node[k] = attr[k];
|
||||
}
|
||||
|
||||
if (content) {
|
||||
JX.DOM.setContent(node, content);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue