Bug 1536819 - Fix node.offsetParent is null error in Rule View r=gl

The editing of selectors in the rule view is broken (see https://bugzil.la/1536867) but that is not related to this issue.

Differential Revision: https://phabricator.services.mozilla.com/D24210

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Ratcliffe 2019-03-22 12:28:09 +00:00
Родитель d2f2f6fd29
Коммит 3f627acfe1
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -450,15 +450,10 @@ CssRuleView.prototype = {
},
/**
* Retrieve the RuleEditor instance that should be stored on
* the offset parent of the node
* Retrieve the RuleEditor instance.
*/
_getRuleEditorForNode: function(node) {
if (!node.offsetParent) {
// some nodes don't have an offsetParent, but their parentNode does
node = node.parentNode;
}
return node.offsetParent._ruleEditor;
return node.closest(".ruleview-rule")._ruleEditor;
},
/**