Revert three changesets (Bug 1451576) for causing bug 1467964 and since it's not generally sound. r=me

MozReview-Commit-ID: CZaLUNlGkX8
This commit is contained in:
Emilio Cobos Álvarez 2018-06-12 16:51:02 -07:00
parent 653d481098
commit b5a8cf3e7c
4 changed files with 7 additions and 20 deletions

View File

@ -241,7 +241,7 @@ DoesNotParticipateInAutoDirection(const Element* aElement)
nodeInfo->Equals(nsGkAtoms::script) ||
nodeInfo->Equals(nsGkAtoms::style) ||
nodeInfo->Equals(nsGkAtoms::textarea) ||
(aElement->IsInAnonymousSubtree() && !aElement->HasDirAuto()));
aElement->IsInAnonymousSubtree());
}
/**
@ -254,8 +254,7 @@ DoesNotAffectDirectionOfAncestors(const Element* aElement)
{
return (DoesNotParticipateInAutoDirection(aElement) ||
aElement->IsHTMLElement(nsGkAtoms::bdi) ||
aElement->HasFixedDir() ||
aElement->IsInAnonymousSubtree());
aElement->HasFixedDir());
}
/**
@ -281,14 +280,10 @@ inline static bool
NodeAffectsDirAutoAncestor(nsINode* aTextNode)
{
Element* parent = aTextNode->GetParentElement();
// In the anonymous content, we limit our implementation to only
// allow the children text node of the direct dir=auto parent in
// the same anonymous subtree to affact the direction.
return (parent &&
!DoesNotParticipateInAutoDirection(parent) &&
parent->NodeOrAncestorHasDirAuto() &&
(!aTextNode->IsInAnonymousSubtree() ||
parent->HasDirAuto()));
!aTextNode->IsInAnonymousSubtree());
}
Directionality
@ -923,19 +918,14 @@ SetDirectionFromNewTextNode(nsTextNode* aTextNode)
void
ResetDirectionSetByTextNode(nsTextNode* aTextNode)
{
// We used to check NodeAffectsDirAutoAncestor() in this function, but
// stopped doing that since calling IsInAnonymousSubtree()
// too late (during nsTextNode::UnbindFromTree) is impossible and this
// function was no-op when there's no directionality map.
if (!aTextNode->HasTextNodeDirectionalityMap()) {
if (!NodeAffectsDirAutoAncestor(aTextNode)) {
nsTextNodeDirectionalityMap::EnsureMapIsClearFor(aTextNode);
return;
}
Directionality dir = GetDirectionFromText(aTextNode->GetText());
if (dir != eDir_NotSet) {
if (dir != eDir_NotSet && aTextNode->HasTextNodeDirectionalityMap()) {
nsTextNodeDirectionalityMap::ResetTextNodeDirection(aTextNode, aTextNode);
} else {
nsTextNodeDirectionalityMap::EnsureMapIsClearFor(aTextNode);
}
}

View File

@ -87,8 +87,6 @@ MakeAnonButton(nsIDocument* aDoc, const char* labelKey,
button->SetIsNativeAnonymousRoot();
button->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
NS_LITERAL_STRING("button"), false);
button->SetAttr(kNameSpaceID_None, nsGkAtoms::dir,
NS_LITERAL_STRING("auto"), false);
// Set the file picking button text depending on the current locale.
nsAutoString buttonTxt;

View File

@ -10,7 +10,7 @@
</html:style>
<html:div dir='rtl'>
<html:div class='file' dir='rtl'>
<html:button dir='ltr'>Browse&#8230;</html:button><label value="No file selected."/>
<html:button>Browse&#8230;</html:button><label value="No file selected."/>
</html:div>
</html:div>
</vbox>

View File

@ -1656,7 +1656,6 @@
ttBtn.classList.add("textTrackItem");
ttBtn.setAttribute("index", tt.index);
ttBtn.setAttribute("dir", "auto");
ttBtn.appendChild(ttText);
this.textTrackList.appendChild(ttBtn);