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

Side by Side Diff: third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp

Issue 2744413002: Set view source without creating a unique origin in XMLDocumentParser (Closed)
Patch Set: Add test Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2008, 2014 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 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 finishParsing(context()); 1541 finishParsing(context());
1542 } 1542 }
1543 1543
1544 m_context = nullptr; 1544 m_context = nullptr;
1545 } 1545 }
1546 } 1546 }
1547 1547
1548 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && 1548 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform &&
1549 hasNoStyleInformation(document()); 1549 hasNoStyleInformation(document());
1550 if (xmlViewerMode) { 1550 if (xmlViewerMode) {
1551 document()->setIsViewSource(true); 1551 if (document()->canExecuteScripts(NotAboutToExecuteScript))
jochen (gone - plz use gerrit) 2017/03/14 20:13:53 why this if ()?
adithyas 2017/03/14 20:55:15 I thought we still need the unique origin when scr
1552 document()->setIsViewSourceWithoutUniqueOrigin();
1553 else
1554 document()->setIsViewSource(true);
1552 transformDocumentToXMLTreeView(*document()); 1555 transformDocumentToXMLTreeView(*document());
1553 } else if (m_sawXSLTransform) { 1556 } else if (m_sawXSLTransform) {
1554 xmlDocPtr doc = 1557 xmlDocPtr doc =
1555 xmlDocPtrForString(document(), m_originalSourceForTransform.toString(), 1558 xmlDocPtrForString(document(), m_originalSourceForTransform.toString(),
1556 document()->url().getString()); 1559 document()->url().getString());
1557 document()->setTransformSource(WTF::makeUnique<TransformSource>(doc)); 1560 document()->setTransformSource(WTF::makeUnique<TransformSource>(doc));
1558 DocumentParser::stopParsing(); 1561 DocumentParser::stopParsing();
1559 } 1562 }
1560 } 1563 }
1561 1564
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 RefPtr<XMLParserContext> parser = 1714 RefPtr<XMLParserContext> parser =
1712 XMLParserContext::createStringParser(&sax, &state); 1715 XMLParserContext::createStringParser(&sax, &state);
1713 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1716 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1714 parseChunk(parser->context(), parseString); 1717 parseChunk(parser->context(), parseString);
1715 finishParsing(parser->context()); 1718 finishParsing(parser->context());
1716 attrsOK = state.gotAttributes; 1719 attrsOK = state.gotAttributes;
1717 return state.attributes; 1720 return state.attributes;
1718 } 1721 }
1719 1722
1720 } // namespace blink 1723 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698