OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Peter Kelly <pmk@post.com> | 2 * Copyright (C) 2000 Peter Kelly <pmk@post.com> |
3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
4 * Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Samuel Weinig <sam@webkit.org> | 5 * Copyright (C) 2007 Samuel Weinig <sam@webkit.org> |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2008 Holger Hans Peter Freyther | 7 * Copyright (C) 2008 Holger Hans Peter Freyther |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
10 * | 10 * |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 363 } |
364 | 364 |
365 private: | 365 private: |
366 Vector<char> m_buffer; | 366 Vector<char> m_buffer; |
367 unsigned m_currentOffset; | 367 unsigned m_currentOffset; |
368 }; | 368 }; |
369 | 369 |
370 static inline void setAttributes(Element* element, Vector<Attribute>& attributeV
ector, ParserContentPolicy parserContentPolicy) | 370 static inline void setAttributes(Element* element, Vector<Attribute>& attributeV
ector, ParserContentPolicy parserContentPolicy) |
371 { | 371 { |
372 if (!scriptingContentIsAllowed(parserContentPolicy)) | 372 if (!scriptingContentIsAllowed(parserContentPolicy)) |
373 element->stripJavaScriptAttributes(attributeVector); | 373 element->stripScriptingAttributes(attributeVector); |
374 element->parserSetAttributes(attributeVector); | 374 element->parserSetAttributes(attributeVector); |
375 } | 375 } |
376 | 376 |
377 static void switchToUTF16(xmlParserCtxtPtr ctxt) | 377 static void switchToUTF16(xmlParserCtxtPtr ctxt) |
378 { | 378 { |
379 // Hack around libxml2's lack of encoding overide support by manually | 379 // Hack around libxml2's lack of encoding overide support by manually |
380 // resetting the encoding to UTF-16 before every chunk. Otherwise libxml | 380 // resetting the encoding to UTF-16 before every chunk. Otherwise libxml |
381 // will detect <?xml version="1.0" encoding="<encoding name>"?> blocks | 381 // will detect <?xml version="1.0" encoding="<encoding name>"?> blocks |
382 // and switch encodings, causing the parse to fail. | 382 // and switch encodings, causing the parse to fail. |
383 const UChar BOM = 0xFEFF; | 383 const UChar BOM = 0xFEFF; |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 sax.startElementNs = attributesStartElementNsHandler; | 1534 sax.startElementNs = attributesStartElementNsHandler; |
1535 sax.initialized = XML_SAX2_MAGIC; | 1535 sax.initialized = XML_SAX2_MAGIC; |
1536 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1536 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1537 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1537 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1538 xmlParseChunk(parser->context(), reinterpret_cast<const char*>(parseString.c
haracters()), parseString.length() * sizeof(UChar), 1); | 1538 xmlParseChunk(parser->context(), reinterpret_cast<const char*>(parseString.c
haracters()), parseString.length() * sizeof(UChar), 1); |
1539 attrsOK = state.gotAttributes; | 1539 attrsOK = state.gotAttributes; |
1540 return state.attributes; | 1540 return state.attributes; |
1541 } | 1541 } |
1542 | 1542 |
1543 } | 1543 } |
OLD | NEW |