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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameSerializer.cpp

Issue 2912213002: Support serializing shadow DOM to MHTML (Closed)
Patch Set: Strip anoter shadow attribute Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void AppendText(StringBuilder& out, Text&) override; 95 void AppendText(StringBuilder& out, Text&) override;
96 bool ShouldIgnoreAttribute(const Element&, const Attribute&) const override; 96 bool ShouldIgnoreAttribute(const Element&, const Attribute&) const override;
97 bool ShouldIgnoreElement(const Element&) const override; 97 bool ShouldIgnoreElement(const Element&) const override;
98 void AppendElement(StringBuilder& out, const Element&, Namespaces*) override; 98 void AppendElement(StringBuilder& out, const Element&, Namespaces*) override;
99 void AppendAttribute(StringBuilder& out, 99 void AppendAttribute(StringBuilder& out,
100 const Element&, 100 const Element&,
101 const Attribute&, 101 const Attribute&,
102 Namespaces*) override; 102 Namespaces*) override;
103 void AppendStartTag(Node&, Namespaces* = nullptr) override; 103 void AppendStartTag(Node&, Namespaces* = nullptr) override;
104 void AppendEndTag(const Element&) override; 104 void AppendEndTag(const Element&) override;
105 std::pair<Node*, Element*> GetAuxiliaryDOMTree(const Element&) const override;
105 106
106 private: 107 private:
107 void AppendAttributeValue(StringBuilder& out, const String& attribute_value); 108 void AppendAttributeValue(StringBuilder& out, const String& attribute_value);
108 void AppendRewrittenAttribute(StringBuilder& out, 109 void AppendRewrittenAttribute(StringBuilder& out,
109 const Element&, 110 const Element&,
110 const String& attribute_name, 111 const String& attribute_name,
111 const String& attribute_value); 112 const String& attribute_value);
112 113
113 FrameSerializer::Delegate& delegate_; 114 FrameSerializer::Delegate& delegate_;
114 Member<const Document> document_; 115 Member<const Document> document_;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 void SerializerMarkupAccumulator::AppendStartTag(Node& node, 226 void SerializerMarkupAccumulator::AppendStartTag(Node& node,
226 Namespaces* namespaces) { 227 Namespaces* namespaces) {
227 MarkupAccumulator::AppendStartTag(node, namespaces); 228 MarkupAccumulator::AppendStartTag(node, namespaces);
228 nodes_.push_back(&node); 229 nodes_.push_back(&node);
229 } 230 }
230 231
231 void SerializerMarkupAccumulator::AppendEndTag(const Element& element) { 232 void SerializerMarkupAccumulator::AppendEndTag(const Element& element) {
232 MarkupAccumulator::AppendEndTag(element); 233 MarkupAccumulator::AppendEndTag(element);
233 } 234 }
234 235
236 std::pair<Node*, Element*> SerializerMarkupAccumulator::GetAuxiliaryDOMTree(
237 const Element& element) const {
238 return delegate_.GetAuxiliaryDOMTree(element);
239 }
240
235 void SerializerMarkupAccumulator::AppendAttributeValue( 241 void SerializerMarkupAccumulator::AppendAttributeValue(
236 StringBuilder& out, 242 StringBuilder& out,
237 const String& attribute_value) { 243 const String& attribute_value) {
238 MarkupFormatter::AppendAttributeValue(out, attribute_value, 244 MarkupFormatter::AppendAttributeValue(out, attribute_value,
239 document_->IsHTMLDocument()); 245 document_->IsHTMLDocument());
240 } 246 }
241 247
242 void SerializerMarkupAccumulator::AppendRewrittenAttribute( 248 void SerializerMarkupAccumulator::AppendRewrittenAttribute(
243 StringBuilder& out, 249 StringBuilder& out,
244 const Element& element, 250 const Element& element,
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 emits_minus = ch == '-'; 637 emits_minus = ch == '-';
632 builder.Append(ch); 638 builder.Append(ch);
633 } 639 }
634 CString escaped_url = builder.ToString().Ascii(); 640 CString escaped_url = builder.ToString().Ascii();
635 return String::Format("saved from url=(%04d)%s", 641 return String::Format("saved from url=(%04d)%s",
636 static_cast<int>(escaped_url.length()), 642 static_cast<int>(escaped_url.length()),
637 escaped_url.data()); 643 escaped_url.data());
638 } 644 }
639 645
640 } // namespace blink 646 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameSerializer.h ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698