| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. |
| 4 * Copyright (C) 2011 Igalia S.L. | 4 * Copyright (C) 2011 Igalia S.L. |
| 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 StyledMarkupAccumulator::StyledMarkupAccumulator(EAbsoluteURLs shouldResolveURLs
, const TextOffset& start, const TextOffset& end, const PassRefPtrWillBeRawPtr<D
ocument> document, EAnnotateForInterchange shouldAnnotate, Node* highestNodeToBe
Serialized) | 42 StyledMarkupAccumulator::StyledMarkupAccumulator(EAbsoluteURLs shouldResolveURLs
, const TextOffset& start, const TextOffset& end, const PassRefPtrWillBeRawPtr<D
ocument> document, EAnnotateForInterchange shouldAnnotate, Node* highestNodeToBe
Serialized) |
| 43 : m_formatter(shouldResolveURLs) | 43 : m_formatter(shouldResolveURLs) |
| 44 , m_start(start) | 44 , m_start(start) |
| 45 , m_end(end) | 45 , m_end(end) |
| 46 , m_document(document) | 46 , m_document(document) |
| 47 , m_shouldAnnotate(shouldAnnotate) | 47 , m_shouldAnnotate(shouldAnnotate) |
| 48 , m_highestNodeToBeSerialized(highestNodeToBeSerialized) | 48 , m_highestNodeToBeSerialized(highestNodeToBeSerialized) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 void StyledMarkupAccumulator::appendString(const String& str) | |
| 53 { | |
| 54 m_result.append(str); | |
| 55 } | |
| 56 | |
| 57 void StyledMarkupAccumulator::appendStartTag(Node& node) | 52 void StyledMarkupAccumulator::appendStartTag(Node& node) |
| 58 { | 53 { |
| 59 appendStartMarkup(m_result, node); | 54 appendStartMarkup(m_result, node); |
| 60 } | 55 } |
| 61 | 56 |
| 62 void StyledMarkupAccumulator::appendEndTag(const Element& element) | 57 void StyledMarkupAccumulator::appendEndTag(const Element& element) |
| 63 { | 58 { |
| 64 appendEndMarkup(m_result, element); | 59 appendEndMarkup(m_result, element); |
| 65 } | 60 } |
| 66 | 61 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // wrappingStyleForSerialization should have removed -webkit-text-decoration
s-in-effect | 190 // wrappingStyleForSerialization should have removed -webkit-text-decoration
s-in-effect |
| 196 ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsI
nEffect)); | 191 ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsI
nEffect)); |
| 197 ASSERT(m_document); | 192 ASSERT(m_document); |
| 198 | 193 |
| 199 StringBuilder openTag; | 194 StringBuilder openTag; |
| 200 openTag.appendLiteral("<div style=\""); | 195 openTag.appendLiteral("<div style=\""); |
| 201 MarkupFormatter::appendAttributeValue(openTag, style->asText(), m_document->
isHTMLDocument()); | 196 MarkupFormatter::appendAttributeValue(openTag, style->asText(), m_document->
isHTMLDocument()); |
| 202 openTag.appendLiteral("\">"); | 197 openTag.appendLiteral("\">"); |
| 203 m_reversedPrecedingMarkup.append(openTag.toString()); | 198 m_reversedPrecedingMarkup.append(openTag.toString()); |
| 204 | 199 |
| 205 appendString("</div>"); | 200 m_result.append("</div>"); |
| 206 } | 201 } |
| 207 | 202 |
| 208 String StyledMarkupAccumulator::takeResults() | 203 String StyledMarkupAccumulator::takeResults() |
| 209 { | 204 { |
| 210 StringBuilder result; | 205 StringBuilder result; |
| 211 result.reserveCapacity(MarkupFormatter::totalLength(m_reversedPrecedingMarku
p) + m_result.length()); | 206 result.reserveCapacity(MarkupFormatter::totalLength(m_reversedPrecedingMarku
p) + m_result.length()); |
| 212 | 207 |
| 213 for (size_t i = m_reversedPrecedingMarkup.size(); i > 0; --i) | 208 for (size_t i = m_reversedPrecedingMarkup.size(); i > 0; --i) |
| 214 result.append(m_reversedPrecedingMarkup[i - 1]); | 209 result.append(m_reversedPrecedingMarkup[i - 1]); |
| 215 | 210 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 bool StyledMarkupAccumulator::shouldAnnotate() const | 248 bool StyledMarkupAccumulator::shouldAnnotate() const |
| 254 { | 249 { |
| 255 return m_shouldAnnotate == AnnotateForInterchange; | 250 return m_shouldAnnotate == AnnotateForInterchange; |
| 256 } | 251 } |
| 257 | 252 |
| 258 void StyledMarkupAccumulator::pushMarkup(const String& str) | 253 void StyledMarkupAccumulator::pushMarkup(const String& str) |
| 259 { | 254 { |
| 260 m_reversedPrecedingMarkup.append(str); | 255 m_reversedPrecedingMarkup.append(str); |
| 261 } | 256 } |
| 262 | 257 |
| 258 void StyledMarkupAccumulator::appendInterchangeNewline() |
| 259 { |
| 260 DEFINE_STATIC_LOCAL(const String, interchangeNewlineString, ("<br class=\""
AppleInterchangeNewline "\">")); |
| 261 m_result.append(interchangeNewlineString); |
| 262 } |
| 263 |
| 263 } // namespace blink | 264 } // namespace blink |
| OLD | NEW |