Bug 1480147 - Add [ChromeOnly] Node.flattenedTreeParentNode, r=mrbkap

This commit is contained in:
Olli Pettay 2018-08-02 14:54:15 +03:00
parent 58e27f3dd9
commit b9479cb08b
4 changed files with 12 additions and 12 deletions

View File

@ -59,6 +59,7 @@
#include "nsAtom.h"
#include "nsIBaseWindow.h"
#include "nsICategoryManager.h"
#include "nsIContentInlines.h"
#include "nsIContentIterator.h"
#include "nsIControllers.h"
#include "nsIDocument.h"
@ -2976,6 +2977,12 @@ nsINode::Localize(JSContext* aCx,
return promise.forget();
}
nsINode*
nsINode::GetFlattenedTreeParentNodeNonInline() const
{
return GetFlattenedTreeParentNode();
}
NS_IMPL_ISUPPORTS(nsNodeWeakReference,
nsIWeakReference)

View File

@ -980,6 +980,8 @@ public:
*/
inline nsINode* GetFlattenedTreeParentNode() const;
nsINode* GetFlattenedTreeParentNodeNonInline() const;
/**
* Like GetFlattenedTreeParentNode, but returns the document for any native
* anonymous content that was generated for ancestor frames of the document

View File

@ -105,6 +105,8 @@ interface Node : EventTarget {
readonly attribute URI? baseURIObject;
[ChromeOnly]
DOMString generateXPath();
[ChromeOnly, Pure, BinaryName="flattenedTreeParentNodeNonInline"]
readonly attribute Node? flattenedTreeParentNode;
/**
* This method provides a fast-path for the Fluent localization system to

View File

@ -122,18 +122,7 @@ TooltipTextProvider.prototype = {
usedTipElement = tipElement;
}
let parent = tipElement.parentNode;
if (defView.ShadowRoot &&
parent instanceof defView.ShadowRoot) {
tipElement = parent.host;
} else {
let slot = tipElement.openOrClosedAssignedSlot;
if (slot) {
tipElement = slot;
} else {
tipElement = parent;
}
}
tipElement = tipElement.flattenedTreeParentNode;
}
return [titleText, XLinkTitleText, SVGTitleText, XULtooltiptextText].some(function(t) {