Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

Issue 14297020: Merge 147281 "Cross-Origin copy&paste / drag&drop allowing XSS v..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1453/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/WebCore/html/parser/HTMLConstructionSite.cpp ('k') | Source/WebCore/xml/parser/XMLDocumentParserQt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698