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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 visitor->trace(m_document); | 54 visitor->trace(m_document); |
55 } | 55 } |
56 | 56 |
57 void XMLErrors::handleError(ErrorType type, const char* message, int lineNumber,
int columnNumber) | 57 void XMLErrors::handleError(ErrorType type, const char* message, int lineNumber,
int columnNumber) |
58 { | 58 { |
59 handleError(type, message, TextPosition(OrdinalNumber::fromOneBasedInt(lineN
umber), OrdinalNumber::fromOneBasedInt(columnNumber))); | 59 handleError(type, message, TextPosition(OrdinalNumber::fromOneBasedInt(lineN
umber), OrdinalNumber::fromOneBasedInt(columnNumber))); |
60 } | 60 } |
61 | 61 |
62 void XMLErrors::handleError(ErrorType type, const char* message, TextPosition po
sition) | 62 void XMLErrors::handleError(ErrorType type, const char* message, TextPosition po
sition) |
63 { | 63 { |
64 if (type == fatal || (m_errorCount < maxErrors && m_lastErrorPosition.m_line
!= position.m_line && m_lastErrorPosition.m_column != position.m_column)) { | 64 if (type == ErrorTypeFatal || (m_errorCount < maxErrors && m_lastErrorPositi
on.m_line != position.m_line && m_lastErrorPosition.m_column != position.m_colum
n)) { |
65 switch (type) { | 65 switch (type) { |
66 case warning: | 66 case ErrorTypeWarning: |
67 appendErrorMessage("warning", position, message); | 67 appendErrorMessage("warning", position, message); |
68 break; | 68 break; |
69 case fatal: | 69 case ErrorTypeFatal: |
70 case nonFatal: | 70 case ErrorTypeNonFatal: |
71 appendErrorMessage("error", position, message); | 71 appendErrorMessage("error", position, message); |
72 } | 72 } |
73 | 73 |
74 m_lastErrorPosition = position; | 74 m_lastErrorPosition = position; |
75 ++m_errorCount; | 75 ++m_errorCount; |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 void XMLErrors::appendErrorMessage(const String& typeString, TextPosition positi
on, const char* message) | 79 void XMLErrors::appendErrorMessage(const String& typeString, TextPosition positi
on, const char* message) |
80 { | 80 { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (firstChild) | 164 if (firstChild) |
165 documentElement->parserInsertBefore(reportElement, *firstChild); | 165 documentElement->parserInsertBefore(reportElement, *firstChild); |
166 else | 166 else |
167 documentElement->parserAppendChild(reportElement); | 167 documentElement->parserAppendChild(reportElement); |
168 | 168 |
169 // FIXME: Why do we need to call this manually? | 169 // FIXME: Why do we need to call this manually? |
170 m_document->updateRenderTreeIfNeeded(); | 170 m_document->updateRenderTreeIfNeeded(); |
171 } | 171 } |
172 | 172 |
173 } // namespace WebCore | 173 } // namespace WebCore |
OLD | NEW |