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

Side by Side Diff: Source/web/WebPageSerializerImpl.cpp

Issue 19098002: Introduce isHTMLHtmlElement and toHTMLHtmlElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 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/xml/parser/XMLDocumentParser.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #include "DOMUtilitiesPrivate.h" 81 #include "DOMUtilitiesPrivate.h"
82 #include "HTMLNames.h" 82 #include "HTMLNames.h"
83 #include "WebFrameImpl.h" 83 #include "WebFrameImpl.h"
84 #include "core/dom/Document.h" 84 #include "core/dom/Document.h"
85 #include "core/dom/DocumentType.h" 85 #include "core/dom/DocumentType.h"
86 #include "core/dom/Element.h" 86 #include "core/dom/Element.h"
87 #include "core/editing/markup.h" 87 #include "core/editing/markup.h"
88 #include "core/html/HTMLAllCollection.h" 88 #include "core/html/HTMLAllCollection.h"
89 #include "core/html/HTMLElement.h" 89 #include "core/html/HTMLElement.h"
90 #include "core/html/HTMLFormElement.h" 90 #include "core/html/HTMLFormElement.h"
91 #include "core/html/HTMLHtmlElement.h"
91 #include "core/html/HTMLMetaElement.h" 92 #include "core/html/HTMLMetaElement.h"
92 #include "core/loader/DocumentLoader.h" 93 #include "core/loader/DocumentLoader.h"
93 #include "core/loader/FrameLoader.h" 94 #include "core/loader/FrameLoader.h"
94 #include "public/platform/WebURL.h" 95 #include "public/platform/WebURL.h"
95 #include "public/platform/WebVector.h" 96 #include "public/platform/WebVector.h"
96 #include "weborigin/KURL.h" 97 #include "weborigin/KURL.h"
97 #include "wtf/text/TextEncoding.h" 98 #include "wtf/text/TextEncoding.h"
98 99
99 using namespace WebCore; 100 using namespace WebCore;
100 101
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 String equiv = meta->httpEquiv(); 140 String equiv = meta->httpEquiv();
140 if (equalIgnoringCase(equiv, "content-type")) { 141 if (equalIgnoringCase(equiv, "content-type")) {
141 String content = meta->content(); 142 String content = meta->content();
142 if (content.length() && content.contains("charset", false)) { 143 if (content.length() && content.contains("charset", false)) {
143 // Find META tag declared charset, we need to skip it when 144 // Find META tag declared charset, we need to skip it when
144 // serializing DOM. 145 // serializing DOM.
145 param->skipMetaElement = element; 146 param->skipMetaElement = element;
146 *needSkip = true; 147 *needSkip = true;
147 } 148 }
148 } 149 }
149 } else if (element->hasTagName(HTMLNames::htmlTag)) { 150 } else if (isHTMLHtmlElement(element)) {
150 // Check something before processing the open tag of HEAD element. 151 // Check something before processing the open tag of HEAD element.
151 // First we add doc type declaration if original document has it. 152 // First we add doc type declaration if original document has it.
152 if (!param->haveSeenDocType) { 153 if (!param->haveSeenDocType) {
153 param->haveSeenDocType = true; 154 param->haveSeenDocType = true;
154 result.append(createMarkup(param->document->doctype())); 155 result.append(createMarkup(param->document->doctype()));
155 } 156 }
156 157
157 // Add MOTW declaration before html tag. 158 // Add MOTW declaration before html tag.
158 // See http://msdn2.microsoft.com/en-us/library/ms537628(VS.85).aspx . 159 // See http://msdn2.microsoft.com/en-us/library/ms537628(VS.85).aspx .
159 result.append(WebPageSerializer::generateMarkOfTheWebDeclaration(par am->url)); 160 result.append(WebPageSerializer::generateMarkOfTheWebDeclaration(par am->url));
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 521
521 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p aram, ForceFlush); 522 encodeAndFlushBuffer(WebPageSerializerClient::CurrentFrameIsFinished, &p aram, ForceFlush);
522 } 523 }
523 524
524 ASSERT(m_dataBuffer.isEmpty()); 525 ASSERT(m_dataBuffer.isEmpty());
525 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali zerClient::AllFramesAreFinished); 526 m_client->didSerializeDataForFrame(KURL(), WebCString("", 0), WebPageSeriali zerClient::AllFramesAreFinished);
526 return didSerialization; 527 return didSerialization;
527 } 528 }
528 529
529 } // namespace WebKit 530 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698