Bug 1365162 - Part 1: Restyle entire subtree when lang="" or xml:lang="" changes. r=emilio

MozReview-Commit-ID: 46YSGTxjshc

--HG--
extra : rebase_source : 427396818c90d74b4ea04ff1308c80d82a337c38
This commit is contained in:
Cameron McCormack 2017-06-05 13:05:19 +08:00
parent cab73ba65a
commit 100ad77dae
2 changed files with 10 additions and 6 deletions

View File

@ -819,12 +819,16 @@ ServoRestyleManager::AttributeChanged(Element* aElement, int32_t aNameSpaceID,
if (aAttribute == nsGkAtoms::style) {
PostRestyleEvent(aElement, eRestyle_StyleAttribute, nsChangeHint(0));
}
// <td> is affected by the cellpadding on its ancestor table,
// so we should restyle the whole subtree
if (aAttribute == nsGkAtoms::cellpadding && aElement->IsHTMLElement(nsGkAtoms::table)) {
// For some attribute changes we must restyle the whole subtree:
//
// * <td> is affected by the cellpadding on its ancestor table
// * lang="" and xml:lang="" can affect all descendants due to :lang()
if ((aAttribute == nsGkAtoms::cellpadding &&
aElement->IsHTMLElement(nsGkAtoms::table)) ||
aAttribute == nsGkAtoms::lang) {
PostRestyleEvent(aElement, eRestyle_Subtree, nsChangeHint(0));
}
if (aElement->IsAttributeMapped(aAttribute)) {
} else if (aElement->IsAttributeMapped(aAttribute)) {
Servo_NoteExplicitHints(aElement, eRestyle_Self, nsChangeHint(0));
}
}

View File

@ -1649,7 +1649,7 @@ fuzzy-if(d2d,5,1) == 622585-1.html 622585-1-ref.html # bug 789402
fuzzy-if(Android,8,300) fuzzy-if(skiaContent,1,40000) == 625409-1.html 625409-1-ref.html
== 627393-1.html about:blank
fuzzy-if(skiaContent,1,500) == 630835-1.html about:blank
fails-if(styloVsGecko||stylo) == 631352-1.html 631352-1-ref.html
== 631352-1.html 631352-1-ref.html
skip-if(!haveTestPlugin) fails-if(Android) fuzzy-if(winWidget&&!layersGPUAccelerated,102,535) fuzzy-if(skiaContent&&!Android,102,11000) HTTP == 632423-1.html 632423-1-ref.html
skip-if(Android) random-if(winWidget||OSX==1010) == 632781-verybig.html 632781-ref.html
== 632781-normalsize.html 632781-ref.html