Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Unified Diff: Source/core/xml/XSLStyleSheetLibxslt.cpp

Issue 333143003: Fix style errors in core/xml/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XSLStyleSheet.h ('k') | Source/core/xml/XSLTExtensions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XSLStyleSheetLibxslt.cpp
diff --git a/Source/core/xml/XSLStyleSheetLibxslt.cpp b/Source/core/xml/XSLStyleSheetLibxslt.cpp
index b4a5679d263f9fd478efd83b222776fc2b0aa146..3f19c86738fd4cd9fc1a7476a16f0b262c9f9889 100644
--- a/Source/core/xml/XSLStyleSheetLibxslt.cpp
+++ b/Source/core/xml/XSLStyleSheetLibxslt.cpp
@@ -32,7 +32,6 @@
#include "core/xml/parser/XMLDocumentParserScope.h"
#include "core/xml/parser/XMLParserInput.h"
#include "wtf/text/CString.h"
-
#include <libxml/uri.h>
#include <libxslt/xsltutils.h>
@@ -44,7 +43,9 @@ XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& originalUR
, m_finalURL(finalURL)
, m_isDisabled(false)
, m_embedded(false)
- , m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them.
+ // Child sheets get marked as processed when the libxslt engine has finally
+ // seen them.
+ , m_processed(false)
, m_stylesheetDoc(0)
, m_stylesheetDocTaken(false)
, m_compilationFailed(false)
@@ -116,10 +117,9 @@ void XSLStyleSheet::clearDocuments()
ResourceFetcher* XSLStyleSheet::fetcher()
{
- Document* document = ownerDocument();
- if (!document)
- return 0;
- return document->fetcher();
+ if (Document* document = ownerDocument())
+ return document->fetcher();
+ return 0;
}
bool XSLStyleSheet::parseString(const String& source)
@@ -130,8 +130,7 @@ bool XSLStyleSheet::parseString(const String& source)
m_stylesheetDocTaken = false;
FrameConsole* console = 0;
- LocalFrame* frame = ownerDocument()->frame();
- if (frame)
+ if (LocalFrame* frame = ownerDocument()->frame())
console = &frame->console();
XMLDocumentParserScope scope(fetcher(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console);
@@ -169,25 +168,26 @@ void XSLStyleSheet::loadChildSheets()
xmlNodePtr stylesheetRoot = document()->children;
- // Top level children may include other things such as DTD nodes, we ignore those.
+ // Top level children may include other things such as DTD nodes, we ignore
+ // those.
while (stylesheetRoot && stylesheetRoot->type != XML_ELEMENT_NODE)
stylesheetRoot = stylesheetRoot->next;
if (m_embedded) {
- // We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the
- // import/include list.
+ // We have to locate (by ID) the appropriate embedded stylesheet
+ // element, so that we can walk the import/include list.
xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(finalURL().string().utf8().data()));
if (!idNode)
return;
stylesheetRoot = idNode->parent;
} else {
- // FIXME: Need to handle an external URI with a # in it. This is a pretty minor edge case, so we'll deal
- // with it later.
+ // FIXME: Need to handle an external URI with a # in it. This is a
+ // pretty minor edge case, so we'll deal with it later.
}
if (stylesheetRoot) {
- // Walk the children of the root element and look for import/include elements.
- // Imports must occur first.
+ // Walk the children of the root element and look for import/include
+ // elements. Imports must occur first.
xmlNodePtr curr = stylesheetRoot->children;
while (curr) {
if (curr->type != XML_ELEMENT_NODE) {
@@ -198,8 +198,9 @@ void XSLStyleSheet::loadChildSheets()
xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE);
loadChildSheet(String::fromUTF8((const char*)uriRef));
xmlFree(uriRef);
- } else
+ } else {
break;
+ }
curr = curr->next;
}
@@ -229,8 +230,8 @@ xsltStylesheetPtr XSLStyleSheet::compileStyleSheet()
if (m_embedded)
return xsltLoadStylesheetPI(document());
- // Certain libxslt versions are corrupting the xmlDoc on compilation failures -
- // hence attempting to recompile after a failure is unsafe.
+ // Certain libxslt versions are corrupting the xmlDoc on compilation
+ // failures - hence attempting to recompile after a failure is unsafe.
if (m_compilationFailed)
return 0;
@@ -273,9 +274,9 @@ xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const
continue; // libxslt has been given this sheet already.
// Check the URI of the child stylesheet against the doc URI.
- // In order to ensure that libxml canonicalized both URLs, we get the original href
- // string from the import rule and canonicalize it using libxml before comparing it
- // with the URI argument.
+ // In order to ensure that libxml canonicalized both URLs, we get
+ // the original href string from the import rule and canonicalize it
+ // using libxml before comparing it with the URI argument.
CString importHref = import->href().utf8();
xmlChar* base = xmlNodeGetBase(parentDoc, (xmlNodePtr)parentDoc);
xmlChar* childURI = xmlBuildURI((const xmlChar*)importHref.data(), base);
« no previous file with comments | « Source/core/xml/XSLStyleSheet.h ('k') | Source/core/xml/XSLTExtensions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698