OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // in the SVG content. | 149 // in the SVG content. |
150 rootElement->reattach(); | 150 rootElement->reattach(); |
151 | 151 |
152 documentElement = body.get(); | 152 documentElement = body.get(); |
153 } | 153 } |
154 #endif | 154 #endif |
155 | 155 |
156 String errorMessages = m_errorMessages.toString(); | 156 String errorMessages = m_errorMessages.toString(); |
157 RefPtr<Element> reportElement = createXHTMLParserErrorHeader(m_document, err
orMessages); | 157 RefPtr<Element> reportElement = createXHTMLParserErrorHeader(m_document, err
orMessages); |
158 | 158 |
159 #if ENABLE(XSLT) | |
160 if (m_document->transformSourceDocument()) { | 159 if (m_document->transformSourceDocument()) { |
161 Vector<Attribute> attributes; | 160 Vector<Attribute> attributes; |
162 attributes.append(Attribute(styleAttr, "white-space: normal")); | 161 attributes.append(Attribute(styleAttr, "white-space: normal")); |
163 RefPtr<Element> paragraph = m_document->createElement(pTag, true); | 162 RefPtr<Element> paragraph = m_document->createElement(pTag, true); |
164 paragraph->parserSetAttributes(attributes); | 163 paragraph->parserSetAttributes(attributes); |
165 paragraph->parserAppendChild(m_document->createTextNode("This document w
as created as the result of an XSL transformation. The line and column numbers g
iven are from the transformed result.")); | 164 paragraph->parserAppendChild(m_document->createTextNode("This document w
as created as the result of an XSL transformation. The line and column numbers g
iven are from the transformed result.")); |
166 reportElement->parserAppendChild(paragraph.release()); | 165 reportElement->parserAppendChild(paragraph.release()); |
167 } | 166 } |
168 #endif | |
169 | 167 |
170 Node* firstChild = documentElement->firstChild(); | 168 Node* firstChild = documentElement->firstChild(); |
171 if (firstChild) | 169 if (firstChild) |
172 documentElement->parserInsertBefore(reportElement, documentElement->firs
tChild()); | 170 documentElement->parserInsertBefore(reportElement, documentElement->firs
tChild()); |
173 else | 171 else |
174 documentElement->parserAppendChild(reportElement); | 172 documentElement->parserAppendChild(reportElement); |
175 | 173 |
176 if (documentElement->attached() && !reportElement->attached()) | 174 if (documentElement->attached() && !reportElement->attached()) |
177 reportElement->attach(); | 175 reportElement->attach(); |
178 | 176 |
179 m_document->updateStyleIfNeeded(); | 177 m_document->updateStyleIfNeeded(); |
180 } | 178 } |
181 | 179 |
182 } // namespace WebCore | 180 } // namespace WebCore |
OLD | NEW |