зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1345119 - Part 2: Server side for retrieving offset parent of DOM node. r=pbro
MozReview-Commit-ID: I51NHlxv6Mp
This commit is contained in:
Родитель
ccab1f6d71
Коммит
ab224ce876
|
@ -2647,6 +2647,22 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
|||
|
||||
return this.layoutActor;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the offset parent of the node
|
||||
* If the offset parent is statically positioned, there is no offset parent
|
||||
* and null is returned.
|
||||
* Returns the DOMNode for the offset parent if it exists
|
||||
*/
|
||||
getOffsetParent: function (domnode) {
|
||||
let offsetParent = domnode.rawNode.offsetParent;
|
||||
|
||||
if (!offsetParent || CssLogic.getComputedStyle(offsetParent).position === "static") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._ref(offsetParent);
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -374,7 +374,15 @@ const walkerSpec = generateActorSpec({
|
|||
response: {
|
||||
actor: RetVal("layout")
|
||||
}
|
||||
}
|
||||
},
|
||||
getOffsetParent: {
|
||||
request: {
|
||||
node: Arg(0, "domnode")
|
||||
},
|
||||
response: {
|
||||
node: RetVal("nullable:domnode")
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче