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

Side by Side Diff: Source/core/page/PageSerializer.cpp

Issue 219903002: Revert 170347 "Convert HTMLFrameOwnerElement and FocusController..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1917/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/testing/MockPagePopupDriver.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) 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // FIXME: For object (plugins) tags and video tag we could replace them by a n image of their current contents. 147 // FIXME: For object (plugins) tags and video tag we could replace them by a n image of their current contents.
148 } 148 }
149 149
150 void SerializerMarkupAccumulator::appendCustomAttributes(StringBuilder& out, con st Element& element, Namespaces* namespaces) 150 void SerializerMarkupAccumulator::appendCustomAttributes(StringBuilder& out, con st Element& element, Namespaces* namespaces)
151 { 151 {
152 if (!element.isFrameOwnerElement()) 152 if (!element.isFrameOwnerElement())
153 return; 153 return;
154 154
155 const HTMLFrameOwnerElement& frameOwner = toHTMLFrameOwnerElement(element); 155 const HTMLFrameOwnerElement& frameOwner = toHTMLFrameOwnerElement(element);
156 Frame* frame = frameOwner.contentFrame(); 156 LocalFrame* frame = frameOwner.contentFrame();
157 // FIXME: RemoteFrames not currently supported here. 157 if (!frame)
158 if (!frame || !frame->isLocalFrame())
159 return; 158 return;
160 159
161 KURL url = toLocalFrame(frame)->document()->url(); 160 KURL url = frame->document()->url();
162 if (url.isValid() && !url.isBlankURL()) 161 if (url.isValid() && !url.isBlankURL())
163 return; 162 return;
164 163
165 // We need to give a fake location to blank frames so they can be referenced by the serialized frame. 164 // We need to give a fake location to blank frames so they can be referenced by the serialized frame.
166 url = m_serializer->urlForBlankFrame(toLocalFrame(frame)); 165 url = m_serializer->urlForBlankFrame(frame);
167 appendAttribute(out, element, Attribute(frameOwnerURLAttributeName(frameOwne r), AtomicString(url.string())), namespaces); 166 appendAttribute(out, element, Attribute(frameOwnerURLAttributeName(frameOwne r), AtomicString(url.string())), namespaces);
168 } 167 }
169 168
170 void SerializerMarkupAccumulator::appendEndTag(const Node& node) 169 void SerializerMarkupAccumulator::appendEndTag(const Node& node)
171 { 170 {
172 if (node.isElementNode() && !shouldIgnoreElement(toElement(node))) 171 if (node.isElementNode() && !shouldIgnoreElement(toElement(node)))
173 MarkupAccumulator::appendEndTag(node); 172 MarkupAccumulator::appendEndTag(node);
174 } 173 }
175 174
176 PageSerializer::PageSerializer(Vector<SerializedResource>* resources) 175 PageSerializer::PageSerializer(Vector<SerializedResource>* resources)
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 if (iter != m_blankFrameURLs.end()) 379 if (iter != m_blankFrameURLs.end())
381 return iter->value; 380 return iter->value;
382 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); 381 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
383 KURL fakeURL(ParsedURLString, url); 382 KURL fakeURL(ParsedURLString, url);
384 m_blankFrameURLs.add(frame, fakeURL); 383 m_blankFrameURLs.add(frame, fakeURL);
385 384
386 return fakeURL; 385 return fakeURL;
387 } 386 }
388 387
389 } 388 }
OLDNEW
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/testing/MockPagePopupDriver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698