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

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

Issue 2538953002: Remove hidden elements from MHTML (Closed)
Patch Set: Address feedback Created 4 years 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 // This class is used to serialize frame's contents back to text (typically 61 // This class is used to serialize frame's contents back to text (typically
62 // HTML). It serializes frame's document and resources such as images and CSS 62 // HTML). It serializes frame's document and resources such as images and CSS
63 // stylesheets. 63 // stylesheets.
64 class CORE_EXPORT FrameSerializer final { 64 class CORE_EXPORT FrameSerializer final {
65 STACK_ALLOCATED(); 65 STACK_ALLOCATED();
66 66
67 public: 67 public:
68 class Delegate { 68 class Delegate {
69 public: 69 public:
70 // Controls whether HTML serialization should skip the given element.
71 virtual bool shouldIgnoreElement(const Element&) { return false; }
72
70 // Controls whether HTML serialization should skip the given attribute. 73 // Controls whether HTML serialization should skip the given attribute.
71 virtual bool shouldIgnoreAttribute(const Element&, const Attribute&) { 74 virtual bool shouldIgnoreAttribute(const Element&, const Attribute&) {
72 return false; 75 return false;
73 } 76 }
74 77
75 // Method allowing the Delegate control which URLs are written into the 78 // Method allowing the Delegate control which URLs are written into the
76 // generated html document. 79 // generated html document.
77 // 80 //
78 // When URL of the element needs to be rewritten, this method should 81 // When URL of the element needs to be rewritten, this method should
79 // return true and populate |rewrittenLink| with a desired value of the 82 // return true and populate |rewrittenLink| with a desired value of the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 HashSet<KURL> m_resourceURLs; 135 HashSet<KURL> m_resourceURLs;
133 136
134 bool m_isSerializingCss; 137 bool m_isSerializingCss;
135 138
136 Delegate& m_delegate; 139 Delegate& m_delegate;
137 }; 140 };
138 141
139 } // namespace blink 142 } // namespace blink
140 143
141 #endif // FrameSerializer_h 144 #endif // FrameSerializer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698