OLD | NEW |
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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 element = block->cloneElementWithoutChildren(); | 896 element = block->cloneElementWithoutChildren(); |
897 else | 897 else |
898 element = createDefaultParagraphElement(document); | 898 element = createDefaultParagraphElement(document); |
899 fillContainerFromString(element.get(), s); | 899 fillContainerFromString(element.get(), s); |
900 } | 900 } |
901 fragment->appendChild(element.release()); | 901 fragment->appendChild(element.release()); |
902 } | 902 } |
903 return fragment.release(); | 903 return fragment.release(); |
904 } | 904 } |
905 | 905 |
906 String createFullMarkup(const Node* node) | |
907 { | |
908 if (!node) | |
909 return String(); | |
910 | |
911 LocalFrame* frame = node->document().frame(); | |
912 if (!frame) | |
913 return String(); | |
914 | |
915 // FIXME: This is never "for interchange". Is that right? | |
916 String markupString = createMarkup(node, IncludeNode, 0); | |
917 if (!node->isDocumentNode() && !node->isDocumentTypeNode()) | |
918 markupString = frame->documentTypeString() + markupString; | |
919 | |
920 return markupString; | |
921 } | |
922 | |
923 String urlToMarkup(const KURL& url, const String& title) | 906 String urlToMarkup(const KURL& url, const String& title) |
924 { | 907 { |
925 StringBuilder markup; | 908 StringBuilder markup; |
926 markup.appendLiteral("<a href=\""); | 909 markup.appendLiteral("<a href=\""); |
927 markup.append(url.string()); | 910 markup.append(url.string()); |
928 markup.appendLiteral("\">"); | 911 markup.appendLiteral("\">"); |
929 MarkupAccumulator::appendCharactersReplacingEntities(markup, title, 0, title
.length(), EntityMaskInPCDATA); | 912 MarkupAccumulator::appendCharactersReplacingEntities(markup, title, 0, title
.length(), EntityMaskInPCDATA); |
930 markup.appendLiteral("</a>"); | 913 markup.appendLiteral("</a>"); |
931 return markup.toString(); | 914 return markup.toString(); |
932 } | 915 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 node->document().updateLayoutIgnorePendingStylesheets(); | 1092 node->document().updateLayoutIgnorePendingStylesheets(); |
1110 | 1093 |
1111 StyledMarkupAccumulator accumulator(0, ResolveAllURLs, AnnotateForNavigation
Transition, nullptr, 0); | 1094 StyledMarkupAccumulator accumulator(0, ResolveAllURLs, AnnotateForNavigation
Transition, nullptr, 0); |
1112 accumulator.serializeNodes(node, NodeTraversal::nextSkippingChildren(*node))
; | 1095 accumulator.serializeNodes(node, NodeTraversal::nextSkippingChildren(*node))
; |
1113 | 1096 |
1114 static const char* documentMarkup = "<!DOCTYPE html><meta name=\"viewport\"
content=\"width=device-width, user-scalable=0\">"; | 1097 static const char* documentMarkup = "<!DOCTYPE html><meta name=\"viewport\"
content=\"width=device-width, user-scalable=0\">"; |
1115 return documentMarkup + accumulator.takeResults(); | 1098 return documentMarkup + accumulator.takeResults(); |
1116 } | 1099 } |
1117 | 1100 |
1118 } | 1101 } |
OLD | NEW |