Changeset 90304 in webkit
- Timestamp:
- Jul 1, 2011, 5:43:45 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90303 r90304 1 2011-07-01 Tim Horton <timothy_horton@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Errors encountered within SVG documents should be reported to the console 6 https://bugs.webkit.org/show_bug.cgi?id=62599 7 8 Add SVGElement::reportAttributeParsingError, which will 9 write a Web Inspector console message if passed an SVGParsingError 10 and the attribute which was being applied, only in the case where 11 there is actually an error. 12 13 Include the SVG document's URI when writing to the Web Inspector 14 console, so that the UI displays both the filename and the line number. 15 16 * svg/SVGDocumentExtensions.cpp: 17 (WebCore::reportMessage): 18 * svg/SVGElement.cpp: 19 (WebCore::SVGElement::reportAttributeParsingError): 20 * svg/SVGElement.h: 21 1 22 2011-07-01 Scott Byer <scottbyer@chromium.org> 2 23 -
trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp
r85413 r90304 199 199 { 200 200 if (Frame* frame = document->frame()) 201 frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, level, message, parserLineNumber(document), String());201 frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, level, message, parserLineNumber(document), document->documentURI()); 202 202 } 203 203 -
trunk/Source/WebCore/svg/SVGElement.cpp
r88989 r90304 104 104 } 105 105 106 void SVGElement::reportAttributeParsingError(SVGParsingError error, Attribute* attribute) 107 { 108 if (error == NoError) 109 return; 110 111 String errorString = "<" + tagName() + "> attribute " + attribute->name().toString() + "=\"" + attribute->value() + "\""; 112 SVGDocumentExtensions* extensions = document()->accessSVGExtensions(); 113 114 if (error == NegativeValueForbiddenError) { 115 extensions->reportError("Invalid negative value for " + errorString); 116 return; 117 } 118 119 if (error == ParsingAttributeFailedError) { 120 extensions->reportError("Invalid value for " + errorString); 121 return; 122 } 123 124 ASSERT_NOT_REACHED(); 125 } 126 127 106 128 bool SVGElement::isSupported(StringImpl* feature, StringImpl* version) const 107 129 { -
trunk/Source/WebCore/svg/SVGElement.h
r87125 r90304 48 48 AnimatedTransformList, 49 49 AnimatedUnknown 50 }; 51 52 enum SVGParsingError { 53 NoError, 54 ParsingAttributeFailedError, 55 NegativeValueForbiddenError 50 56 }; 51 57 … … 124 130 SVGElementRareData* ensureRareSVGData(); 125 131 132 void reportAttributeParsingError(SVGParsingError, Attribute*); 133 126 134 private: 127 135 friend class SVGElementInstance;
Note:
See TracChangeset
for help on using the changeset viewer.