Changeset 18669 in webkit
- Timestamp:
- Jan 8, 2007 9:50:01 AM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r18666 r18669 1 2007-01-08 Sam Weinig <sam@webkit.org> 2 3 Reviewed by ap and the rubber stamp of Maciej. 4 5 Patch for http://bugs.webkit.org/show_bug.cgi?id=12164 6 Cleanup Tokenizers 7 8 - Moves Tokenizer class into its own file. 9 - Move XMLTokenizer declaration from XMLTokenizer.cpp to XMLTokenizer.h 10 - Fixup #includes. 11 12 * WebCore.xcodeproj/project.pbxproj: 13 * dom/Document.cpp: 14 (WebCore::Document::createTokenizer): 15 * dom/Tokenizer.h: Added. 16 (WebCore::Tokenizer::Tokenizer): 17 (WebCore::Tokenizer::~Tokenizer): 18 (WebCore::Tokenizer::stopParsing): 19 (WebCore::Tokenizer::processingData): 20 (WebCore::Tokenizer::executingScript): 21 (WebCore::Tokenizer::wantsRawData): 22 (WebCore::Tokenizer::writeRawData): 23 (WebCore::Tokenizer::inViewSourceMode): 24 (WebCore::Tokenizer::setInViewSourceMode): 25 (WebCore::Tokenizer::wellFormed): 26 (WebCore::Tokenizer::lineNumber): 27 (WebCore::Tokenizer::columnNumber): 28 * dom/XMLTokenizer.cpp: 29 * dom/XMLTokenizer.h: 30 (WebCore::XMLTokenizer::): 31 (WebCore::XMLTokenizer::setIsXHTMLDocument): 32 (WebCore::XMLTokenizer::isXHTMLDocument): 33 (WebCore::XMLTokenizer::wellFormed): 34 * html/HTMLElement.cpp: 35 * html/HTMLTokenizer.h: 36 (WebCore::Token::reset): 37 (WebCore::HTMLTokenizer::checkBuffer): 38 (WebCore::HTMLTokenizer::checkScriptBuffer): 39 (WebCore::HTMLTokenizer::State::State): 40 (WebCore::HTMLTokenizer::State::setBit): 41 * xml/XSLTProcessor.cpp: 42 1 43 2007-01-08 Sam Weinig <sam@webkit.org> 2 44 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r18659 r18669 2732 2732 BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */; }; 2733 2733 BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */; }; 2734 BCCFBAE80B5152ED0001F1D7 /* Tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCFBAE70B5152ED0001F1D7 /* Tokenizer.h */; }; 2734 2735 BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */; }; 2735 2736 BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; }; … … 5855 5856 BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLViewSourceDocument.h; sourceTree = "<group>"; }; 5856 5857 BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLViewSourceDocument.cpp; sourceTree = "<group>"; }; 5858 BCCFBAE70B5152ED0001F1D7 /* Tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Tokenizer.h; sourceTree = "<group>"; }; 5857 5859 BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSComputedStyleDeclaration.cpp; sourceTree = "<group>"; }; 5858 5860 BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSComputedStyleDeclaration.h; sourceTree = "<group>"; }; … … 9352 9354 isa = PBXGroup; 9353 9355 children = ( 9354 AA4C3A740B2B1679002334A2 /* StyleElement.cpp */,9355 AA4C3A750B2B1679002334A2 /* StyleElement.h */,9356 9356 BC3B364705C9D5E200E42902 /* AtomicStringList.h */, 9357 9357 A8C4A7FC09D563270003AC8D /* Attr.cpp */, … … 9415 9415 939885C108B7E3D100E707C4 /* EventNames.cpp */, 9416 9416 939885C208B7E3D100E707C4 /* EventNames.h */, 9417 E12EDBE90B308E0B002704B6 /* EventTarget.cpp */, 9418 E12EDB7A0B308A78002704B6 /* EventTarget.h */, 9417 9419 85AFA7420AAF298400E84305 /* EventTarget.idl */, 9418 E12EDB7A0B308A78002704B6 /* EventTarget.h */,9419 E12EDBE90B308E0B002704B6 /* EventTarget.cpp */,9420 9420 14EC267E09CA07E000E1EEEC /* EventTargetNode.cpp */, 9421 9421 14EC267D09CA07E000E1EEEC /* EventTargetNode.h */, … … 9479 9479 A8C4A7EC09D563270003AC8D /* StyledElement.cpp */, 9480 9480 A8C4A7EB09D563270003AC8D /* StyledElement.h */, 9481 AA4C3A740B2B1679002334A2 /* StyleElement.cpp */, 9482 AA4C3A750B2B1679002334A2 /* StyleElement.h */, 9481 9483 6550B69B099DF0270090D781 /* Text.cpp */, 9482 9484 6550B69C099DF0270090D781 /* Text.h */, 9483 9485 93EEC1F609C2877700C515D1 /* Text.idl */, 9486 BCCFBAE70B5152ED0001F1D7 /* Tokenizer.h */, 9484 9487 854FE72C0A2297BE0058D7AD /* Traversal.cpp */, 9485 9488 854FE72D0A2297BE0058D7AD /* Traversal.h */, … … 9489 9492 85031B370A44EFC700F992E0 /* UIEvent.cpp */, 9490 9493 85031B380A44EFC700F992E0 /* UIEvent.h */, 9494 141B94EE09EC425A000E9413 /* UIEvent.idl */, 9491 9495 93354A3B0B24F8C9003F6DEA /* UIEventWithKeyState.cpp */, 9492 9496 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */, 9493 141B94EE09EC425A000E9413 /* UIEvent.idl */,9494 9497 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */, 9495 9498 85031B3B0A44EFC700F992E0 /* WheelEvent.h */, … … 10956 10959 062287840B4DB322000C34DF /* FocusDirection.h in Headers */, 10957 10960 1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */, 10961 BCCFBAE80B5152ED0001F1D7 /* Tokenizer.h in Headers */, 10958 10962 AA882B300B4EF5EB006D26D1 /* PointerEventsHitRules.h in Headers */, 10959 10963 ); -
trunk/WebCore/dom/Document.cpp
r18610 r18669 1212 1212 } 1213 1213 1214 Tokenizer *Document::createTokenizer()1215 { 1216 return new XMLTokenizer(this, m_view);1214 Tokenizer* Document::createTokenizer() 1215 { 1216 return new XMLTokenizer(this, m_view); 1217 1217 } 1218 1218 -
trunk/WebCore/dom/Tokenizer.h
r18665 r18669 4 4 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 5 5 * Copyright (C) 2005, 2006 Apple Computer, Inc. 6 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 22 23 */ 23 24 24 #ifndef XML_Tokenizer_h_ 25 #define XML_Tokenizer_h_ 26 27 #include "StringHash.h" 28 #include <wtf/HashMap.h> 25 #ifndef Tokenizer_h 26 #define Tokenizer_h 29 27 30 28 namespace WebCore { 31 29 32 class DocLoader; 33 class DocumentFragment; 34 class Document; 35 class Element; 36 class FrameView; 37 class SegmentedString; 30 class SegmentedString; 38 31 39 class Tokenizer 40 { 41 public: 42 Tokenizer(bool viewSourceMode = false) 43 : m_parserStopped(false) 44 , m_inViewSourceMode(viewSourceMode) 45 {} 46 47 virtual ~Tokenizer() {} 32 class Tokenizer { 33 public: 34 Tokenizer(bool viewSourceMode = false) 35 : m_parserStopped(false) 36 , m_inViewSourceMode(viewSourceMode) 37 { 38 } 48 39 49 // Script output must be prepended, while new data 50 // received during executing a script must be appended, hence the 51 // extra bool to be able to distinguish between both cases. 52 // document.write() always uses false, while the loader uses true. 53 virtual bool write(const SegmentedString&, bool appendData) = 0; 54 virtual void finish() = 0; 55 virtual bool isWaitingForScripts() const = 0; 56 virtual void stopParsing() { m_parserStopped = true; } 57 virtual bool processingData() const { return false; } 58 virtual int executingScript() const { return 0; } 40 virtual ~Tokenizer() { } 59 41 60 virtual bool wantsRawData() const { return false; } 61 virtual bool writeRawData(const char* data, int len) { return false; } 62 63 bool inViewSourceMode() const { return m_inViewSourceMode; } 64 void setInViewSourceMode(bool mode) { m_inViewSourceMode = mode; } 42 // Script output must be prepended, while new data 43 // received during executing a script must be appended, hence the 44 // extra bool to be able to distinguish between both cases. 45 // document.write() always uses false, while the loader uses true. 46 virtual bool write(const SegmentedString&, bool appendData) = 0; 47 virtual void finish() = 0; 48 virtual bool isWaitingForScripts() const = 0; 49 virtual void stopParsing() { m_parserStopped = true; } 50 virtual bool processingData() const { return false; } 51 virtual int executingScript() const { return 0; } 65 52 66 virtual bool wellFormed() const { return true; } 53 virtual bool wantsRawData() const { return false; } 54 virtual bool writeRawData(const char* data, int len) { return false; } 67 55 68 virtual int lineNumber() const { return -1; }69 virtual int columnNumber() const { return -1; }56 bool inViewSourceMode() const { return m_inViewSourceMode; } 57 void setInViewSourceMode(bool mode) { m_inViewSourceMode = mode; } 70 58 71 protected: 72 // The tokenizer has buffers, so parsing may continue even after 73 // it stops receiving data. We use m_parserStopped to stop the tokenizer 74 // even when it has buffered data. 75 bool m_parserStopped; 76 77 bool m_inViewSourceMode; 78 }; 59 virtual bool wellFormed() const { return true; } 79 60 80 Tokenizer* newXMLTokenizer(Document*, FrameView* = 0); 81 #if XSLT_SUPPORT 82 void* xmlDocPtrForString(DocLoader*, const String& source, const DeprecatedString& URL); 83 void setLoaderForLibXMLCallbacks(DocLoader*); 84 #endif 85 HashMap<String, String> parseAttributes(const String&, bool& attrsOK); 86 bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent = 0); 61 virtual int lineNumber() const { return -1; } 62 virtual int columnNumber() const { return -1; } 87 63 88 } 64 protected: 65 // The tokenizer has buffers, so parsing may continue even after 66 // it stops receiving data. We use m_parserStopped to stop the tokenizer 67 // even when it has buffered data. 68 bool m_parserStopped; 69 bool m_inViewSourceMode; 70 }; 89 71 90 #endif 72 } // namespace WebCore 73 74 #endif // Tokenizer_h -
trunk/WebCore/dom/XMLTokenizer.cpp
r18652 r18669 5 5 * Copyright (C) 2005, 2006 Apple Computer, Inc. 6 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 8 * 8 9 * This library is free software; you can redistribute it and/or … … 70 71 const int maxErrors = 25; 71 72 72 typedef HashMap<StringImpl*, StringImpl*> PrefixForNamespaceMap;73 74 class PendingCallbacks;75 76 class XMLTokenizer : public Tokenizer, public CachedResourceClient {77 public:78 XMLTokenizer(Document*, FrameView* = 0);79 XMLTokenizer(DocumentFragment*, Element*);80 ~XMLTokenizer();81 82 enum ErrorType { warning, nonFatal, fatal };83 84 // from Tokenizer85 virtual bool write(const SegmentedString& str, bool);86 virtual void finish();87 virtual bool isWaitingForScripts() const;88 virtual void stopParsing();89 90 void end();91 92 void pauseParsing();93 void resumeParsing();94 95 void setIsXHTMLDocument(bool isXHTML) { m_isXHTMLDocument = isXHTML; }96 bool isXHTMLDocument() const { return m_isXHTMLDocument; }97 98 // from CachedResourceClient99 virtual void notifyFinished(CachedResource* finishedObj);100 101 // callbacks from parser SAX102 void error(ErrorType, const char* message, va_list args);103 void startElementNs(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int nb_namespaces, const xmlChar** namespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes);104 void endElementNs();105 void characters(const xmlChar* s, int len);106 void processingInstruction(const xmlChar* target, const xmlChar* data);107 void cdataBlock(const xmlChar* s, int len);108 void comment(const xmlChar* s);109 void startDocument(const xmlChar* version, const xmlChar* encoding, int standalone);110 void internalSubset(const xmlChar* name, const xmlChar* externalID, const xmlChar* systemID);111 112 void handleError(ErrorType type, const char* m, int lineNumber, int columnNumber);113 114 virtual bool wellFormed() const { return !m_sawError; }115 116 int lineNumber() const;117 int columnNumber() const;118 119 private:120 void initializeParserContext();121 void setCurrentNode(Node*);122 123 void insertErrorMessageBlock();124 125 bool enterText();126 void exitText();127 128 Document* m_doc;129 FrameView* m_view;130 131 String m_originalSourceForTransform;132 133 xmlParserCtxtPtr m_context;134 Node* m_currentNode;135 bool m_currentNodeIsReferenced;136 137 bool m_sawError;138 bool m_sawXSLTransform;139 bool m_sawFirstElement;140 bool m_isXHTMLDocument;141 142 bool m_parserPaused;143 bool m_requestingScript;144 bool m_finishCalled;145 146 int m_errorCount;147 int m_lastErrorLine;148 int m_lastErrorColumn;149 String m_errorMessages;150 151 CachedScript* m_pendingScript;152 RefPtr<Element> m_scriptElement;153 int m_scriptStartLine;154 155 bool m_parsingFragment;156 String m_defaultNamespaceURI;157 PrefixForNamespaceMap m_prefixToNamespaceMap;158 159 PendingCallbacks* m_pendingCallbacks;160 SegmentedString m_pendingSrc;161 };162 163 73 class PendingCallbacks { 164 74 public: … … 1411 1321 #endif 1412 1322 1413 Tokenizer* newXMLTokenizer(Document* d, FrameView* v)1414 {1415 return new XMLTokenizer(d, v);1416 }1417 1418 1323 int XMLTokenizer::lineNumber() const 1419 1324 { -
trunk/WebCore/dom/XMLTokenizer.h
r18652 r18669 4 4 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 5 5 * Copyright (C) 2005, 2006 Apple Computer, Inc. 6 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 22 23 */ 23 24 24 #ifndef XML _Tokenizer_h_25 #define XML _Tokenizer_h_25 #ifndef XMLTokenizer_h 26 #define XMLTokenizer_h 26 27 28 #include "CachedResourceClient.h" 29 #include "SegmentedString.h" 27 30 #include "StringHash.h" 31 #include "Tokenizer.h" 32 #include <libxml/tree.h> 33 #include <libxml/xmlstring.h> 28 34 #include <wtf/HashMap.h> 29 35 30 36 namespace WebCore { 31 37 32 class DocLoader; 33 class DocumentFragment; 34 class Document; 35 class Element; 36 class FrameView; 37 class SegmentedString; 38 class Node; 39 class CachedScript; 40 class DocLoader; 41 class DocumentFragment; 42 class Document; 43 class Element; 44 class FrameView; 45 class PendingCallbacks; 38 46 39 class Tokenizer 40 { 41 public: 42 Tokenizer(bool viewSourceMode = false) 43 : m_parserStopped(false) 44 , m_inViewSourceMode(viewSourceMode) 45 {} 46 47 virtual ~Tokenizer() {} 47 class XMLTokenizer : public Tokenizer, public CachedResourceClient { 48 public: 49 XMLTokenizer(Document*, FrameView* = 0); 50 XMLTokenizer(DocumentFragment*, Element*); 51 ~XMLTokenizer(); 48 52 49 // Script output must be prepended, while new data 50 // received during executing a script must be appended, hence the 51 // extra bool to be able to distinguish between both cases. 52 // document.write() always uses false, while the loader uses true. 53 virtual bool write(const SegmentedString&, bool appendData) = 0; 54 virtual void finish() = 0; 55 virtual bool isWaitingForScripts() const = 0; 56 virtual void stopParsing() { m_parserStopped = true; } 57 virtual bool processingData() const { return false; } 58 virtual int executingScript() const { return 0; } 53 enum ErrorType { warning, nonFatal, fatal }; 59 54 60 virtual bool wantsRawData() const { return false; }61 virtual bool writeRawData(const char* data, int len) { return false; }62 63 bool inViewSourceMode() const { return m_inViewSourceMode; }64 void setInViewSourceMode(bool mode) { m_inViewSourceMode = mode; }55 // from Tokenizer 56 virtual bool write(const SegmentedString&, bool appendData); 57 virtual void finish(); 58 virtual bool isWaitingForScripts() const; 59 virtual void stopParsing(); 65 60 66 virtual bool wellFormed() const { return true; }61 void end(); 67 62 68 virtual int lineNumber() const { return -1; }69 virtual int columnNumber() const { return -1; }63 void pauseParsing(); 64 void resumeParsing(); 70 65 71 protected: 72 // The tokenizer has buffers, so parsing may continue even after 73 // it stops receiving data. We use m_parserStopped to stop the tokenizer 74 // even when it has buffered data. 75 bool m_parserStopped; 76 77 bool m_inViewSourceMode; 78 }; 66 void setIsXHTMLDocument(bool isXHTML) { m_isXHTMLDocument = isXHTML; } 67 bool isXHTMLDocument() const { return m_isXHTMLDocument; } 79 68 80 Tokenizer* newXMLTokenizer(Document*, FrameView* = 0); 69 // from CachedResourceClient 70 virtual void notifyFinished(CachedResource* finishedObj); 71 72 // callbacks from parser SAX 73 void error(ErrorType, const char* message, va_list args); 74 void startElementNs(const xmlChar* xmlLocalName, const xmlChar* xmlPrefix, const xmlChar* xmlURI, int nb_namespaces, const xmlChar** namespaces, int nb_attributes, int nb_defaulted, const xmlChar** libxmlAttributes); 75 void endElementNs(); 76 void characters(const xmlChar* s, int len); 77 void processingInstruction(const xmlChar* target, const xmlChar* data); 78 void cdataBlock(const xmlChar* s, int len); 79 void comment(const xmlChar* s); 80 void startDocument(const xmlChar* version, const xmlChar* encoding, int standalone); 81 void internalSubset(const xmlChar* name, const xmlChar* externalID, const xmlChar* systemID); 82 83 void handleError(ErrorType type, const char* m, int lineNumber, int columnNumber); 84 85 virtual bool wellFormed() const { return !m_sawError; } 86 87 int lineNumber() const; 88 int columnNumber() const; 89 90 private: 91 void initializeParserContext(); 92 void setCurrentNode(Node*); 93 94 void insertErrorMessageBlock(); 95 96 bool enterText(); 97 void exitText(); 98 99 Document* m_doc; 100 FrameView* m_view; 101 102 String m_originalSourceForTransform; 103 104 xmlParserCtxtPtr m_context; 105 Node* m_currentNode; 106 bool m_currentNodeIsReferenced; 107 108 bool m_sawError; 109 bool m_sawXSLTransform; 110 bool m_sawFirstElement; 111 bool m_isXHTMLDocument; 112 113 bool m_parserPaused; 114 bool m_requestingScript; 115 bool m_finishCalled; 116 117 int m_errorCount; 118 int m_lastErrorLine; 119 int m_lastErrorColumn; 120 String m_errorMessages; 121 122 CachedScript* m_pendingScript; 123 RefPtr<Element> m_scriptElement; 124 int m_scriptStartLine; 125 126 bool m_parsingFragment; 127 String m_defaultNamespaceURI; 128 129 typedef HashMap<StringImpl*, StringImpl*> PrefixForNamespaceMap; 130 PrefixForNamespaceMap m_prefixToNamespaceMap; 131 132 PendingCallbacks* m_pendingCallbacks; 133 SegmentedString m_pendingSrc; 134 }; 135 81 136 #if XSLT_SUPPORT 82 137 void* xmlDocPtrForString(DocLoader*, const String& source, const DeprecatedString& URL); 83 138 void setLoaderForLibXMLCallbacks(DocLoader*); 84 139 #endif 140 85 141 HashMap<String, String> parseAttributes(const String&, bool& attrsOK); 86 142 bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent = 0); 87 143 88 } 144 } // namespace WebCore 89 145 90 #endif 146 #endif // XMLTokenizer_h -
trunk/WebCore/html/HTMLElement.cpp
r18610 r18669 40 40 #include "HTMLTokenizer.h" 41 41 #include "TextIterator.h" 42 #include "XMLTokenizer.h" 42 43 #include "markup.h" 43 44 -
trunk/WebCore/html/HTMLTokenizer.h
r18652 r18669 24 24 */ 25 25 26 #ifndef HTMLT OKENIZER_H27 #define HTMLT OKENIZER_H26 #ifndef HTMLTokenizer_h 27 #define HTMLTokenizer_h 28 28 29 29 #include "DeprecatedPtrQueue.h" … … 31 31 #include "SegmentedString.h" 32 32 #include "Timer.h" 33 #include " XMLTokenizer.h"33 #include "Tokenizer.h" 34 34 #include "CachedResourceClient.h" 35 35 … … 51 51 * text contains the text. 52 52 */ 53 class Token 54 { 53 class Token { 55 54 public: 56 55 Token() : beginTag(true), flat(false) { } … … 64 63 { 65 64 attrs = 0; 66 text = 0; 65 text = 0; 67 66 tagName = nullAtom; 68 67 beginTag = true; … … 79 78 //----------------------------------------------------------------------------- 80 79 81 class HTMLTokenizer : public Tokenizer, public CachedResourceClient 82 { 80 class HTMLTokenizer : public Tokenizer, public CachedResourceClient { 83 81 public: 84 82 HTMLTokenizer(HTMLDocument*); … … 124 122 inline void checkBuffer(int len = 10) 125 123 { 126 if ( (dest - buffer) > size-len)124 if ((dest - buffer) > size - len) 127 125 enlargeBuffer(len); 128 126 } 127 129 128 inline void checkScriptBuffer(int len = 10) 130 129 { 131 if ( scriptCodeSize + len >= scriptCodeMaxSize)130 if (scriptCodeSize + len >= scriptCodeMaxSize) 132 131 enlargeScriptBuffer(len); 133 132 } … … 184 183 class State { 185 184 public: 186 State() : m_bits(0) { }185 State() : m_bits(0) { } 187 186 188 187 TagState tagState() const { return static_cast<TagState>(m_bits & TagMask); } … … 255 254 ForceSynchronous = 1 << 23 256 255 }; 257 258 void setBit(StateBits bit, bool value) 259 { 260 if (value) 261 m_bits |= bit; 262 else 256 257 void setBit(StateBits bit, bool value) 258 { 259 if (value) 260 m_bits |= bit; 261 else 263 262 m_bits &= ~bit; 264 263 } … … 274 273 // Name of an attribute that we just scanned. 275 274 AtomicString attrName; 276 275 277 276 // Used to store the code of a srcipting sequence 278 277 UChar* scriptCode; … … 332 331 // we'll just make it large enough to handle all imaginable cases. 333 332 #define CBUFLEN 1024 334 char cBuffer[CBUFLEN +2];333 char cBuffer[CBUFLEN + 2]; 335 334 unsigned int m_cBufferPos; 336 335 337 336 SegmentedString src; 338 337 Document* m_doc; … … 346 345 UChar decodeNamedEntity(const char*); 347 346 348 } 349 350 #endif 347 } // namespace WebCore 348 349 #endif // HTMLTokenizer_h -
trunk/WebCore/xml/XSLTProcessor.cpp
r18644 r18669 27 27 #include "XSLTProcessor.h" 28 28 29 #include "CString.h" 29 30 #include "Cache.h" 30 #include "CString.h"31 31 #include "DOMImplementation.h" 32 #include "TextResourceDecoder.h"33 32 #include "DocLoader.h" 34 33 #include "DocumentFragment.h" … … 43 42 #include "ResourceResponse.h" 44 43 #include "Text.h" 44 #include "TextResourceDecoder.h" 45 #include "XMLTokenizer.h" 45 46 #include "loader.h" 46 47 #include "markup.h"
Note: See TracChangeset
for help on using the changeset viewer.