зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1566046: rename `GetParentOrHostNode` to `GetParentOrShadowHostNode`. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D38078
This commit is contained in:
Родитель
22b330ecb3
Коммит
1669cc6770
|
@ -1396,12 +1396,13 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
|
|||
|
||||
if (table) {
|
||||
nsIContent* parentContent =
|
||||
aContent->GetParentOrHostNode()->AsContent();
|
||||
aContent->GetParentOrShadowHostNode()->AsContent();
|
||||
nsIFrame* parentFrame = nullptr;
|
||||
if (parentContent) {
|
||||
parentFrame = parentContent->GetPrimaryFrame();
|
||||
if (!parentFrame || !parentFrame->IsTableWrapperFrame()) {
|
||||
parentContent = parentContent->GetParentOrHostNode()->AsContent();
|
||||
parentContent =
|
||||
parentContent->GetParentOrShadowHostNode()->AsContent();
|
||||
if (parentContent) {
|
||||
parentFrame = parentContent->GetPrimaryFrame();
|
||||
}
|
||||
|
|
|
@ -759,7 +759,7 @@ static nsINode* FindChromeAccessOnlySubtreeOwner(nsINode* aNode) {
|
|||
aNode = aNode->GetParentNode();
|
||||
}
|
||||
|
||||
return aNode ? aNode->GetParentOrHostNode() : nullptr;
|
||||
return aNode ? aNode->GetParentOrShadowHostNode() : nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<nsINode> FindChromeAccessOnlySubtreeOwner(
|
||||
|
|
|
@ -261,7 +261,7 @@ nsINode* nsINode::GetRootNode(const GetRootNodeOptions& aOptions) {
|
|||
return SubtreeRoot();
|
||||
}
|
||||
|
||||
nsINode* nsINode::GetParentOrHostNode() const {
|
||||
nsINode* nsINode::GetParentOrShadowHostNode() const {
|
||||
if (mParent) {
|
||||
return mParent;
|
||||
}
|
||||
|
|
|
@ -884,11 +884,7 @@ class nsINode : public mozilla::dom::EventTarget {
|
|||
*/
|
||||
nsINode* GetParentNode() const { return mParent; }
|
||||
|
||||
/**
|
||||
* This is similar to above, but in case 'this' is ShadowRoot, we return its
|
||||
* host element.
|
||||
*/
|
||||
nsINode* GetParentOrHostNode() const;
|
||||
nsINode* GetParentOrShadowHostNode() const;
|
||||
|
||||
enum FlattenedParentType { eNotForStyle, eForStyle };
|
||||
|
||||
|
|
|
@ -244,8 +244,8 @@ bool SVGUseElement::IsCyclicReferenceTo(const Element& aTarget) const {
|
|||
if (mOriginal && mOriginal->IsCyclicReferenceTo(aTarget)) {
|
||||
return true;
|
||||
}
|
||||
for (nsINode* parent = GetParentOrHostNode(); parent;
|
||||
parent = parent->GetParentOrHostNode()) {
|
||||
for (nsINode* parent = GetParentOrShadowHostNode(); parent;
|
||||
parent = parent->GetParentOrShadowHostNode()) {
|
||||
if (parent == &aTarget) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -10048,7 +10048,7 @@ nsresult HTMLEditRules::ConfirmSelectionInBody() {
|
|||
// XXXsmaug this code is insane.
|
||||
nsINode* temp = selectionStartPoint.GetContainer();
|
||||
while (temp && !temp->IsHTMLElement(nsGkAtoms::body)) {
|
||||
temp = temp->GetParentOrHostNode();
|
||||
temp = temp->GetParentOrShadowHostNode();
|
||||
}
|
||||
|
||||
// If we aren't in the <body> element, force the issue.
|
||||
|
@ -10074,7 +10074,7 @@ nsresult HTMLEditRules::ConfirmSelectionInBody() {
|
|||
// XXXsmaug this code is insane.
|
||||
temp = selectionEndPoint.GetContainer();
|
||||
while (temp && !temp->IsHTMLElement(nsGkAtoms::body)) {
|
||||
temp = temp->GetParentOrHostNode();
|
||||
temp = temp->GetParentOrShadowHostNode();
|
||||
}
|
||||
|
||||
// If we aren't in the <body> element, force the issue.
|
||||
|
|
|
@ -4725,7 +4725,7 @@ UniquePtr<RangePaintInfo> PresShell::CreateRangePaintInfo(
|
|||
break;
|
||||
}
|
||||
|
||||
ancestor = ancestor->GetParentOrHostNode();
|
||||
ancestor = ancestor->GetParentOrShadowHostNode();
|
||||
}
|
||||
|
||||
// use the nearest ancestor frame that includes all continuations as the
|
||||
|
|
|
@ -1669,7 +1669,7 @@ int32_t nsLayoutUtils::DoCompareTreePosition(
|
|||
AutoTArray<nsINode*, 32> content1Ancestors;
|
||||
nsINode* c1;
|
||||
for (c1 = aContent1; c1 && c1 != aCommonAncestor;
|
||||
c1 = c1->GetParentOrHostNode()) {
|
||||
c1 = c1->GetParentOrShadowHostNode()) {
|
||||
content1Ancestors.AppendElement(c1);
|
||||
}
|
||||
if (!c1 && aCommonAncestor) {
|
||||
|
@ -1681,7 +1681,7 @@ int32_t nsLayoutUtils::DoCompareTreePosition(
|
|||
AutoTArray<nsINode*, 32> content2Ancestors;
|
||||
nsINode* c2;
|
||||
for (c2 = aContent2; c2 && c2 != aCommonAncestor;
|
||||
c2 = c2->GetParentOrHostNode()) {
|
||||
c2 = c2->GetParentOrShadowHostNode()) {
|
||||
content2Ancestors.AppendElement(c2);
|
||||
}
|
||||
if (!c2 && aCommonAncestor) {
|
||||
|
@ -1718,7 +1718,7 @@ int32_t nsLayoutUtils::DoCompareTreePosition(
|
|||
|
||||
// content1Ancestor != content2Ancestor, so they must be siblings with the
|
||||
// same parent
|
||||
nsINode* parent = content1Ancestor->GetParentOrHostNode();
|
||||
nsINode* parent = content1Ancestor->GetParentOrShadowHostNode();
|
||||
#ifdef DEBUG
|
||||
// TODO: remove the uglyness, see bug 598468.
|
||||
NS_ASSERTION(gPreventAssertInCompareTreePosition || parent,
|
||||
|
|
Загрузка…
Ссылка в новой задаче