| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |