/// <summary>Check if a pages counter is mentioned.</summary> /// <param name="styleSheet">the stylesheet to analyze</param> /// <param name="cssContext">the CSS context</param> private void CheckIfPagesCounterMentioned(CssStyleSheet styleSheet, CssContext cssContext) { // The presence of counter(pages) means that theoretically relayout may be needed. // We don't know it yet because that selector might not even be used, but // when we know it for sure, it's too late because the Document is created right in the start. if (CssStyleSheetAnalyzer.CheckPagesCounterPresence(styleSheet)) { cssContext.SetPagesCounterPresent(true); } }
/// <summary>Check if a pages counter is mentioned.</summary> /// <param name="cssContents">the CSS contents</param> /// <param name="cssContext">the CSS context</param> private void CheckIfPagesCounterMentioned(String cssContents, CssContext cssContext) { // TODO more efficient (avoid searching in text string) and precise (e.g. skip spaces) check during the parsing. if (cssContents.Contains("counter(pages)") || cssContents.Contains("counters(pages")) { // The presence of counter(pages) means that theoretically relayout may be needed. // We don't know it yet because that selector might not even be used, but // when we know it for sure, it's too late because the Document is created right in the start. cssContext.SetPagesCounterPresent(true); } }