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

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

Issue 33353003: Have Frame::tree() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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/PageGroupLoadDeferrer.cpp ('k') | Source/core/page/Settings.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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 serializeCSSStyleSheet(sheet, url); 241 serializeCSSStyleSheet(sheet, url);
242 ASSERT(m_resourceURLs.contains(url)); 242 ASSERT(m_resourceURLs.contains(url));
243 } 243 }
244 } else if (element->hasTagName(HTMLNames::styleTag)) { 244 } else if (element->hasTagName(HTMLNames::styleTag)) {
245 HTMLStyleElement* styleElement = toHTMLStyleElement(element); 245 HTMLStyleElement* styleElement = toHTMLStyleElement(element);
246 if (CSSStyleSheet* sheet = styleElement->sheet()) 246 if (CSSStyleSheet* sheet = styleElement->sheet())
247 serializeCSSStyleSheet(sheet, KURL()); 247 serializeCSSStyleSheet(sheet, KURL());
248 } 248 }
249 } 249 }
250 250
251 for (Frame* childFrame = frame->tree()->firstChild(); childFrame; childFrame = childFrame->tree()->nextSibling()) 251 for (Frame* childFrame = frame->tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling())
252 serializeFrame(childFrame); 252 serializeFrame(childFrame);
253 } 253 }
254 254
255 void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KUR L& url) 255 void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet* styleSheet, const KUR L& url)
256 { 256 {
257 StringBuilder cssText; 257 StringBuilder cssText;
258 for (unsigned i = 0; i < styleSheet->length(); ++i) { 258 for (unsigned i = 0; i < styleSheet->length(); ++i) {
259 CSSRule* rule = styleSheet->item(i); 259 CSSRule* rule = styleSheet->item(i);
260 String itemText = rule->cssText(); 260 String itemText = rule->cssText();
261 if (!itemText.isEmpty()) { 261 if (!itemText.isEmpty()) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 if (iter != m_blankFrameURLs.end()) 376 if (iter != m_blankFrameURLs.end())
377 return iter->value; 377 return iter->value;
378 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); 378 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
379 KURL fakeURL(ParsedURLString, url); 379 KURL fakeURL(ParsedURLString, url);
380 m_blankFrameURLs.add(frame, fakeURL); 380 m_blankFrameURLs.add(frame, fakeURL);
381 381
382 return fakeURL; 382 return fakeURL;
383 } 383 }
384 384
385 } 385 }
OLDNEW
« no previous file with comments | « Source/core/page/PageGroupLoadDeferrer.cpp ('k') | Source/core/page/Settings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698