|
From: Jeff R. <jef...@us...> - 2005-11-19 03:13:37
|
Update of /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12283/src/SharpVectorCss/SharpVectors/Dom/Css Modified Files: CssXmlElement.cs XPathSelector.cs Log Message: Library wide changes for scripting support and automated re-rendering Index: XPathSelector.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/XPathSelector.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- XPathSelector.cs 23 Oct 2005 23:39:29 -0000 1.6 +++ XPathSelector.cs 19 Nov 2005 03:13:23 -0000 1.7 @@ -298,10 +298,10 @@ int specificity = sel.Specificity; // specificity = 123 - specificityA = (int)Math.Floor(specificity / 100); + specificityA = (int)Math.Floor((double) specificity / 100); specificity -= specificityA*100; // specificity = 23 - specificityB = (int)Math.Floor((specificity) / 10); + specificityB = (int)Math.Floor((double) (specificity) / 10); specificity -= specificityB * 10; // specificity = 3 @@ -672,7 +672,7 @@ } [Test] - [Ignore("This test will fail if run because we are searching for id nodes based on attribute name, not DTD ID type")] + [Ignore("DTD support disabled")] public void TestIdMatchingNoDtd() { // id on <b> is not defined in the DTD as ID @@ -786,6 +786,7 @@ public void TestTargetMatching() { Console.WriteLine(doc.Url); + } */ @@ -928,6 +929,7 @@ { XPathSelector xsel = new XPathSelector(sel, nsTable); xsel.Matches(e); + // Console.WriteLine(xsel.XPath); } } Index: CssXmlElement.cs =================================================================== RCS file: /cvsroot/svgdomcsharp/SharpVectorGraphics/src/SharpVectorCss/SharpVectors/Dom/Css/CssXmlElement.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- CssXmlElement.cs 12 Feb 2005 17:21:39 -0000 1.17 +++ CssXmlElement.cs 19 Nov 2005 03:13:23 -0000 1.18 @@ -102,17 +102,19 @@ #endregion #region Update handling - public void CssInvalidate() + public virtual void CssInvalidate() { - // TODO: why is this being called during load? - cachedCSD = null; - - foreach(XmlNode child in ChildNodes) + // TODO: why is this being called during load? + foreach(XmlNode child in ChildNodes) { if (child is CssXmlElement) ((CssXmlElement)child).CssInvalidate(); } + // Kill the cache + cachedCSD = null; + + // Notify FireCssChange(); } @@ -150,6 +152,10 @@ /// <see cref="CssXmlDocument"/> public virtual void AttributeChange(Object src, XmlNodeChangedEventArgs args) { + // Invalidate the CSS, the cascade for the CSS heirarchy will need to be recomputed + // We do this before and after the change because we need to invalidate the old and new locations + CssInvalidate(); + XmlAttribute attribute = src as XmlAttribute; if(attribute != null) @@ -161,6 +167,9 @@ FireAttributeChange(src, args); FireParentNodeChange(src, args, false); FireChildNodeChange(src, args, false); + + // Invalidate the CSS, the cascade for the CSS heirarchy will need to be recomputed + CssInvalidate(); } /// <summary> @@ -179,8 +188,6 @@ style = null; break; } - // Invalidate the CSS - CssInvalidate(); } } |