diff options
Diffstat (limited to 'chromium/third_party/libxslt/src/libxslt/xsltutils.c')
-rw-r--r-- | chromium/third_party/libxslt/src/libxslt/xsltutils.c | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/chromium/third_party/libxslt/src/libxslt/xsltutils.c b/chromium/third_party/libxslt/src/libxslt/xsltutils.c index adefde988f9..94097b9d209 100644 --- a/chromium/third_party/libxslt/src/libxslt/xsltutils.c +++ b/chromium/third_party/libxslt/src/libxslt/xsltutils.c @@ -1578,7 +1578,15 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, xmlOutputBufferWriteString(buf, "?>\n"); } if (result->children != NULL) { - xmlNodePtr child = result->children; + xmlNodePtr children = result->children; + xmlNodePtr child = children; + + /* + * Hack to avoid quadratic behavior when scanning + * result->children in xmlGetIntSubset called by + * xmlNodeDumpOutput. + */ + result->children = NULL; while (child != NULL) { xmlNodeDumpOutput(buf, result, child, 0, (indent == 1), @@ -1591,6 +1599,8 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, } if (indent) xmlOutputBufferWriteString(buf, "\n"); + + result->children = children; } xmlOutputBufferFlush(buf); } @@ -1788,6 +1798,8 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len, return 0; } +#ifdef WITH_PROFILER + /************************************************************************ * * * Generating profiling information * @@ -2265,6 +2277,8 @@ xsltGetProfileInformation(xsltTransformContextPtr ctxt) return ret; } +#endif /* WITH_PROFILER */ + /************************************************************************ * * * Hooks for libxml2 XPath * @@ -2288,25 +2302,7 @@ xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags) { xmlXPathCompExprPtr ret; if (style != NULL) { -#ifdef XSLT_REFACTORED_XPATHCOMP - if (XSLT_CCTXT(style)) { - /* - * Proposed by Jerome Pesenti - * -------------------------- - * For better efficiency we'll reuse the compilation - * context's XPath context. For the common stylesheet using - * XPath expressions this will reduce compilation time to - * about 50%. - * - * See http://mail.gnome.org/archives/xslt/2006-April/msg00037.html - */ - xpathCtxt = XSLT_CCTXT(style)->xpathCtxt; - xpathCtxt->doc = style->doc; - } else - xpathCtxt = xmlXPathNewContext(style->doc); -#else - xpathCtxt = xmlXPathNewContext(style->doc); -#endif + xpathCtxt = style->principal->xpathCtxt; if (xpathCtxt == NULL) return NULL; xpathCtxt->dict = style->dict; @@ -2322,13 +2318,9 @@ xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags) { */ ret = xmlXPathCtxtCompile(xpathCtxt, str); -#ifdef XSLT_REFACTORED_XPATHCOMP - if ((style == NULL) || (! XSLT_CCTXT(style))) { + if (style == NULL) { xmlXPathFreeContext(xpathCtxt); } -#else - xmlXPathFreeContext(xpathCtxt); -#endif /* * TODO: there is a lot of optimizations which should be possible * like variable slot precomputations, function precomputations, etc. @@ -2358,6 +2350,23 @@ xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str) { * * ************************************************************************/ +int xslDebugStatus; + +/** + * xsltGetDebuggerStatus: + * + * Get xslDebugStatus. + * + * Returns the value of xslDebugStatus. + */ +int +xsltGetDebuggerStatus(void) +{ + return(xslDebugStatus); +} + +#ifdef WITH_DEBUGGER + /* * There is currently only 3 debugging callback defined * Debugger callbacks are disabled by default @@ -2378,8 +2387,6 @@ static xsltDebuggerCallbacks xsltDebuggerCurrentCallbacks = { NULL /* drop */ }; -int xslDebugStatus; - /** * xsltSetDebuggerStatus: * @value : the value to be set @@ -2393,19 +2400,6 @@ xsltSetDebuggerStatus(int value) } /** - * xsltGetDebuggerStatus: - * - * Get xslDebugStatus. - * - * Returns the value of xslDebugStatus. - */ -int -xsltGetDebuggerStatus(void) -{ - return(xslDebugStatus); -} - -/** * xsltSetDebuggerCallbacks: * @no : number of callbacks * @block : the block of callbacks @@ -2479,3 +2473,5 @@ xslDropCall(void) xsltDebuggerCurrentCallbacks.drop(); } +#endif /* WITH_DEBUGGER */ + |