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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Create elements for display | 119 // Create elements for display |
120 RefPtr<Element> documentElement = m_document->documentElement(); | 120 RefPtr<Element> documentElement = m_document->documentElement(); |
121 if (!documentElement) { | 121 if (!documentElement) { |
122 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); | 122 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); |
123 RefPtr<Element> body = m_document->createElement(bodyTag, true); | 123 RefPtr<Element> body = m_document->createElement(bodyTag, true); |
124 rootElement->parserAppendChild(body); | 124 rootElement->parserAppendChild(body); |
125 m_document->parserAppendChild(rootElement); | 125 m_document->parserAppendChild(rootElement); |
126 documentElement = body.get(); | 126 documentElement = body.get(); |
127 } else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) { | 127 } else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) { |
128 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); | 128 RefPtr<Element> rootElement = m_document->createElement(htmlTag, true); |
| 129 RefPtr<Element> head = m_document->createElement(headTag, true); |
| 130 RefPtr<Element> style = m_document->createElement(styleTag, true); |
| 131 head->parserAppendChild(style); |
| 132 style->parserAppendChild(m_document->createTextNode("html, body { height
: 100% } parsererror + svg { width: 100%; height: 100% }")); |
| 133 style->finishParsingChildren(); |
| 134 rootElement->parserAppendChild(head); |
129 RefPtr<Element> body = m_document->createElement(bodyTag, true); | 135 RefPtr<Element> body = m_document->createElement(bodyTag, true); |
130 rootElement->parserAppendChild(body); | 136 rootElement->parserAppendChild(body); |
131 | 137 |
132 m_document->parserRemoveChild(*documentElement); | 138 m_document->parserRemoveChild(*documentElement); |
133 | 139 |
134 body->parserAppendChild(documentElement); | 140 body->parserAppendChild(documentElement); |
135 m_document->parserAppendChild(rootElement); | 141 m_document->parserAppendChild(rootElement); |
136 | 142 |
137 documentElement = body.get(); | 143 documentElement = body.get(); |
138 } | 144 } |
(...skipping 14 matching lines...) Expand all Loading... |
153 if (firstChild) | 159 if (firstChild) |
154 documentElement->parserInsertBefore(reportElement, *firstChild); | 160 documentElement->parserInsertBefore(reportElement, *firstChild); |
155 else | 161 else |
156 documentElement->parserAppendChild(reportElement); | 162 documentElement->parserAppendChild(reportElement); |
157 | 163 |
158 // FIXME: Why do we need to call this manually? | 164 // FIXME: Why do we need to call this manually? |
159 m_document->updateRenderTreeIfNeeded(); | 165 m_document->updateRenderTreeIfNeeded(); |
160 } | 166 } |
161 | 167 |
162 } // namespace WebCore | 168 } // namespace WebCore |
OLD | NEW |