From 37fc0ea58ed004dd0bbfcc404ba5d6786994e1b2 Mon Sep 17 00:00:00 2001 From: "vidur%netscape.com" Date: Fri, 5 Feb 1999 19:55:56 +0000 Subject: [PATCH] Hooked up style hint for id, class and dir git-svn-id: svn://10.0.0.236/trunk@19868 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/content/src/nsGenericHTMLElement.cpp | 13 ++++++++++++- .../html/content/src/nsGenericHTMLElement.cpp | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index ebb8bd91fa3..d7865fe0106 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -1902,13 +1902,24 @@ static PRBool AttributeChangeRequiresReflow(const nsIAtom* aAttribute) aAttribute==nsHTMLAtoms::width); } +static PRBool AttributeChangeRequiresReframe(const nsIAtom* aAttribute) +{ + return (PRBool) + (aAttribute==nsHTMLAtoms::id || + aAttribute==nsHTMLAtoms::kClass || + aAttribute==nsHTMLAtoms::dir); +} + PRBool nsGenericHTMLElement::SetStyleHintForCommonAttributes(const nsIContent* aNode, const nsIAtom* aAttribute, PRInt32* aHint) { PRBool setHint = PR_TRUE; - if (PR_TRUE == AttributeChangeRequiresReflow(aAttribute)) { + if (PR_TRUE == AttributeChangeRequiresReframe(aAttribute)) { + *aHint = NS_STYLE_HINT_FRAMECHANGE; + } + else if (PR_TRUE == AttributeChangeRequiresReflow(aAttribute)) { *aHint = NS_STYLE_HINT_REFLOW; } else if (PR_TRUE == AttributeChangeRequiresRepaint(aAttribute)) { diff --git a/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp b/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp index ebb8bd91fa3..d7865fe0106 100644 --- a/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/layout/html/content/src/nsGenericHTMLElement.cpp @@ -1902,13 +1902,24 @@ static PRBool AttributeChangeRequiresReflow(const nsIAtom* aAttribute) aAttribute==nsHTMLAtoms::width); } +static PRBool AttributeChangeRequiresReframe(const nsIAtom* aAttribute) +{ + return (PRBool) + (aAttribute==nsHTMLAtoms::id || + aAttribute==nsHTMLAtoms::kClass || + aAttribute==nsHTMLAtoms::dir); +} + PRBool nsGenericHTMLElement::SetStyleHintForCommonAttributes(const nsIContent* aNode, const nsIAtom* aAttribute, PRInt32* aHint) { PRBool setHint = PR_TRUE; - if (PR_TRUE == AttributeChangeRequiresReflow(aAttribute)) { + if (PR_TRUE == AttributeChangeRequiresReframe(aAttribute)) { + *aHint = NS_STYLE_HINT_FRAMECHANGE; + } + else if (PR_TRUE == AttributeChangeRequiresReflow(aAttribute)) { *aHint = NS_STYLE_HINT_REFLOW; } else if (PR_TRUE == AttributeChangeRequiresRepaint(aAttribute)) {