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

Side by Side Diff: Source/core/editing/markup.cpp

Issue 144063008: Use Node.isDocumentTypeNode more (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Start using isDocumentTypeNode Created 6 years, 11 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 | « Source/core/dom/Range.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | 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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2011 Igalia S.L. 4 * Copyright (C) 2011 Igalia S.L.
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 if (!node) 879 if (!node)
880 return String(); 880 return String();
881 881
882 Frame* frame = node->document().frame(); 882 Frame* frame = node->document().frame();
883 if (!frame) 883 if (!frame)
884 return String(); 884 return String();
885 885
886 // FIXME: This is never "for interchange". Is that right? 886 // FIXME: This is never "for interchange". Is that right?
887 String markupString = createMarkup(node, IncludeNode, 0); 887 String markupString = createMarkup(node, IncludeNode, 0);
888 Node::NodeType nodeType = node->nodeType(); 888 Node::NodeType nodeType = node->nodeType();
889 if (nodeType != Node::DOCUMENT_NODE && nodeType != Node::DOCUMENT_TYPE_NODE) 889 if (nodeType != Node::DOCUMENT_NODE && !node->isDocumentTypeNode())
890 markupString = frame->documentTypeString() + markupString; 890 markupString = frame->documentTypeString() + markupString;
891 891
892 return markupString; 892 return markupString;
893 } 893 }
894 894
895 String urlToMarkup(const KURL& url, const String& title) 895 String urlToMarkup(const KURL& url, const String& title)
896 { 896 {
897 StringBuilder markup; 897 StringBuilder markup;
898 markup.appendLiteral("<a href=\""); 898 markup.appendLiteral("<a href=\"");
899 markup.append(url.string()); 899 markup.append(url.string());
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 return; 1043 return;
1044 1044
1045 RefPtr<Text> textNode = toText(node.get()); 1045 RefPtr<Text> textNode = toText(node.get());
1046 RefPtr<Text> textNext = toText(next); 1046 RefPtr<Text> textNext = toText(next);
1047 textNode->appendData(textNext->data()); 1047 textNode->appendData(textNext->data());
1048 if (textNext->parentNode()) // Might have been removed by mutation event. 1048 if (textNext->parentNode()) // Might have been removed by mutation event.
1049 textNext->remove(exceptionState); 1049 textNext->remove(exceptionState);
1050 } 1050 }
1051 1051
1052 } 1052 }
OLDNEW
« no previous file with comments | « Source/core/dom/Range.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698