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

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

Issue 302213002: Convert page-level classes to handle RemoteFrames from FrameTree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 6 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
« no previous file with comments | « Source/core/page/PageAnimator.cpp ('k') | Source/core/page/ScopedPageLoadDeferrer.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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 serializeCSSStyleSheet(sheet, url); 245 serializeCSSStyleSheet(sheet, url);
246 ASSERT(m_resourceURLs.contains(url)); 246 ASSERT(m_resourceURLs.contains(url));
247 } 247 }
248 } else if (isHTMLStyleElement(element)) { 248 } else if (isHTMLStyleElement(element)) {
249 HTMLStyleElement& styleElement = toHTMLStyleElement(element); 249 HTMLStyleElement& styleElement = toHTMLStyleElement(element);
250 if (CSSStyleSheet* sheet = styleElement.sheet()) 250 if (CSSStyleSheet* sheet = styleElement.sheet())
251 serializeCSSStyleSheet(sheet, KURL()); 251 serializeCSSStyleSheet(sheet, KURL());
252 } 252 }
253 } 253 }
254 254
255 for (LocalFrame* childFrame = frame->tree().firstChild(); childFrame; childF rame = childFrame->tree().nextSibling()) 255 for (Frame* childFrame = frame->tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling()) {
256 serializeFrame(childFrame); 256 if (childFrame->isLocalFrame())
257 serializeFrame(toLocalFrame(childFrame));
258 }
257 } 259 }
258 260
259 void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KUR L& url) 261 void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KUR L& url)
260 { 262 {
261 StringBuilder cssText; 263 StringBuilder cssText;
262 for (unsigned i = 0; i < styleSheet->length(); ++i) { 264 for (unsigned i = 0; i < styleSheet->length(); ++i) {
263 CSSRule* rule = styleSheet->item(i); 265 CSSRule* rule = styleSheet->item(i);
264 String itemText = rule->cssText(); 266 String itemText = rule->cssText();
265 if (!itemText.isEmpty()) { 267 if (!itemText.isEmpty()) {
266 cssText.append(itemText); 268 cssText.append(itemText);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 if (iter != m_blankFrameURLs.end()) 383 if (iter != m_blankFrameURLs.end())
382 return iter->value; 384 return iter->value;
383 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); 385 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
384 KURL fakeURL(ParsedURLString, url); 386 KURL fakeURL(ParsedURLString, url);
385 m_blankFrameURLs.add(frame, fakeURL); 387 m_blankFrameURLs.add(frame, fakeURL);
386 388
387 return fakeURL; 389 return fakeURL;
388 } 390 }
389 391
390 } 392 }
OLDNEW
« no previous file with comments | « Source/core/page/PageAnimator.cpp ('k') | Source/core/page/ScopedPageLoadDeferrer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698