Bug 1249119 - Prevent exception when opening inspector on a loading document. r=pbro

MozReview-Commit-ID: 9TNRUblT0SW

--HG--
extra : rebase_source : c8c30017cf5cb5be947a5edd5ff48908e0bf2db4
This commit is contained in:
Alexandre Poirot 2016-10-19 05:26:40 -07:00
Родитель c50962f647
Коммит a1c295cf6b
2 изменённых файлов: 7 добавлений и 2 удалений

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

@ -633,8 +633,10 @@ MarkupContainer.prototype = {
// Markup tree item should have accessible selected state.
this.tagLine.setAttribute("aria-selected", value);
if (this._selected) {
this.markup.getContainer(this.markup._rootNode).elt.setAttribute(
"aria-activedescendant", this.id);
let container = this.markup.getContainer(this.markup._rootNode);
if (container) {
container.elt.setAttribute("aria-activedescendant", this.id);
}
this.tagLine.setAttribute("selected", "");
this.tagState.classList.add("theme-selected");
} else {

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

@ -618,6 +618,9 @@ var NodeActor = exports.NodeActor = protocol.ActorClassWithSpec(nodeSpec, {
* Get a unique selector string for this node.
*/
getUniqueSelector: function () {
if (Cu.isDeadWrapper(this.rawNode)) {
return "";
}
return CssLogic.findCssSelector(this.rawNode);
},