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

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

Issue 181783005: Have Element::ensureMutableInlineStyle() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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/inspector/InspectorStyleSheet.cpp ('k') | Source/core/svg/SVGFontFaceElement.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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 ASSERT(styleSheet->ownerDocument()); 269 ASSERT(styleSheet->ownerDocument());
270 Document& document = *styleSheet->ownerDocument(); 270 Document& document = *styleSheet->ownerDocument();
271 // Some rules have resources associated with them that we need to retrie ve. 271 // Some rules have resources associated with them that we need to retrie ve.
272 if (rule->type() == CSSRule::IMPORT_RULE) { 272 if (rule->type() == CSSRule::IMPORT_RULE) {
273 CSSImportRule* importRule = toCSSImportRule(rule); 273 CSSImportRule* importRule = toCSSImportRule(rule);
274 KURL importURL = document.completeURL(importRule->href()); 274 KURL importURL = document.completeURL(importRule->href());
275 if (m_resourceURLs.contains(importURL)) 275 if (m_resourceURLs.contains(importURL))
276 continue; 276 continue;
277 serializeCSSStyleSheet(importRule->styleSheet(), importURL); 277 serializeCSSStyleSheet(importRule->styleSheet(), importURL);
278 } else if (rule->type() == CSSRule::FONT_FACE_RULE) { 278 } else if (rule->type() == CSSRule::FONT_FACE_RULE) {
279 retrieveResourcesForProperties(toCSSFontFaceRule(rule)->styleRule()- >properties(), document); 279 retrieveResourcesForProperties(&toCSSFontFaceRule(rule)->styleRule() ->properties(), document);
280 } else if (rule->type() == CSSRule::STYLE_RULE) { 280 } else if (rule->type() == CSSRule::STYLE_RULE) {
281 retrieveResourcesForProperties(toCSSStyleRule(rule)->styleRule()->pr operties(), document); 281 retrieveResourcesForProperties(&toCSSStyleRule(rule)->styleRule()->p roperties(), document);
282 } 282 }
283 } 283 }
284 284
285 if (url.isValid() && !m_resourceURLs.contains(url)) { 285 if (url.isValid() && !m_resourceURLs.contains(url)) {
286 // FIXME: We should check whether a charset has been specified and if no ne was found add one. 286 // FIXME: We should check whether a charset has been specified and if no ne was found add one.
287 WTF::TextEncoding textEncoding(styleSheet->contents()->charset()); 287 WTF::TextEncoding textEncoding(styleSheet->contents()->charset());
288 ASSERT(textEncoding.isValid()); 288 ASSERT(textEncoding.isValid());
289 String textString = cssText.toString(); 289 String textString = cssText.toString();
290 CString text = textEncoding.normalizeAndEncode(textString, WTF::Entities ForUnencodables); 290 CString text = textEncoding.normalizeAndEncode(textString, WTF::Entities ForUnencodables);
291 m_resources->append(SerializedResource(url, String("text/css"), SharedBu ffer::create(text.data(), text.length()))); 291 m_resources->append(SerializedResource(url, String("text/css"), SharedBu ffer::create(text.data(), text.length())));
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 if (iter != m_blankFrameURLs.end()) 380 if (iter != m_blankFrameURLs.end())
381 return iter->value; 381 return iter->value;
382 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++); 382 String url = "wyciwyg://frame/" + String::number(m_blankFrameCounter++);
383 KURL fakeURL(ParsedURLString, url); 383 KURL fakeURL(ParsedURLString, url);
384 m_blankFrameURLs.add(frame, fakeURL); 384 m_blankFrameURLs.add(frame, fakeURL);
385 385
386 return fakeURL; 386 return fakeURL;
387 } 387 }
388 388
389 } 389 }
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorStyleSheet.cpp ('k') | Source/core/svg/SVGFontFaceElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698