OLD | NEW |
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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 322 } |
323 | 323 |
324 // Some rules have resources associated with them that we need to retrie
ve. | 324 // Some rules have resources associated with them that we need to retrie
ve. |
325 serializeCSSRule(rule); | 325 serializeCSSRule(rule); |
326 } | 326 } |
327 | 327 |
328 if (shouldAddURL(url)) { | 328 if (shouldAddURL(url)) { |
329 WTF::TextEncoding textEncoding(styleSheet.contents()->charset()); | 329 WTF::TextEncoding textEncoding(styleSheet.contents()->charset()); |
330 ASSERT(textEncoding.isValid()); | 330 ASSERT(textEncoding.isValid()); |
331 String textString = cssText.toString(); | 331 String textString = cssText.toString(); |
332 CString text = textEncoding.encode(textString, WTF::EntitiesForUnencodab
les); | 332 CString text = textEncoding.encode(textString, WTF::CSSEncodedEntitiesFo
rUnencodables); |
333 m_resources->append(SerializedResource(url, String("text/css"), SharedBu
ffer::create(text.data(), text.length()))); | 333 m_resources->append(SerializedResource(url, String("text/css"), SharedBu
ffer::create(text.data(), text.length()))); |
334 m_resourceURLs.add(url); | 334 m_resourceURLs.add(url); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 void FrameSerializer::serializeCSSRule(CSSRule* rule) | 338 void FrameSerializer::serializeCSSRule(CSSRule* rule) |
339 { | 339 { |
340 ASSERT(rule->parentStyleSheet()->ownerDocument()); | 340 ASSERT(rule->parentStyleSheet()->ownerDocument()); |
341 Document& document = *rule->parentStyleSheet()->ownerDocument(); | 341 Document& document = *rule->parentStyleSheet()->ownerDocument(); |
342 | 342 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 continue; | 476 continue; |
477 } | 477 } |
478 emitsMinus = ch == '-'; | 478 emitsMinus = ch == '-'; |
479 builder.append(ch); | 479 builder.append(ch); |
480 } | 480 } |
481 CString escapedUrl = builder.toString().ascii(); | 481 CString escapedUrl = builder.toString().ascii(); |
482 return String::format("saved from url=(%04d)%s", static_cast<int>(escapedUrl
.length()), escapedUrl.data()); | 482 return String::format("saved from url=(%04d)%s", static_cast<int>(escapedUrl
.length()), escapedUrl.data()); |
483 } | 483 } |
484 | 484 |
485 } // namespace blink | 485 } // namespace blink |
OLD | NEW |