| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 { | 271 { |
| 272 if (!m_accumulator) { | 272 if (!m_accumulator) { |
| 273 ASSERT(!m_lastClosed); | 273 ASSERT(!m_lastClosed); |
| 274 return; | 274 return; |
| 275 } | 275 } |
| 276 if (!m_lastClosed) | 276 if (!m_lastClosed) |
| 277 return; | 277 return; |
| 278 ContainerNode* parent = Strategy::parent(*m_lastClosed); | 278 ContainerNode* parent = Strategy::parent(*m_lastClosed); |
| 279 if (!parent) | 279 if (!parent) |
| 280 return; | 280 return; |
| 281 m_wrappingStyle = EditingStyle::wrappingStyleForSerialization(parent, should
Annotate()); | 281 if (shouldAnnotate()) { |
| 282 m_wrappingStyle = EditingStyle::wrappingStyleForAnnotatedSerialization(p
arent); |
| 283 return; |
| 284 } |
| 285 m_wrappingStyle = EditingStyle::wrappingStyleForSerialization(parent); |
| 282 } | 286 } |
| 283 | 287 |
| 284 template<typename Strategy> | 288 template<typename Strategy> |
| 285 Node* StyledMarkupTraverser<Strategy>::traverse(Node* startNode, Node* pastEnd) | 289 Node* StyledMarkupTraverser<Strategy>::traverse(Node* startNode, Node* pastEnd) |
| 286 { | 290 { |
| 287 WillBeHeapVector<RawPtrWillBeMember<ContainerNode>> ancestorsToClose; | 291 WillBeHeapVector<RawPtrWillBeMember<ContainerNode>> ancestorsToClose; |
| 288 Node* next; | 292 Node* next; |
| 289 Node* lastClosed = nullptr; | 293 Node* lastClosed = nullptr; |
| 290 for (Node* n = startNode; n != pastEnd; n = next) { | 294 for (Node* n = startNode; n != pastEnd; n = next) { |
| 291 // According to <rdar://problem/5730668>, it is possible for n to blow | 295 // According to <rdar://problem/5730668>, it is possible for n to blow |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if (element.isHTMLElement() && shouldAnnotate()) | 490 if (element.isHTMLElement() && shouldAnnotate()) |
| 487 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)
); | 491 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)
); |
| 488 | 492 |
| 489 return inlineStyle; | 493 return inlineStyle; |
| 490 } | 494 } |
| 491 | 495 |
| 492 template class StyledMarkupSerializer<EditingStrategy>; | 496 template class StyledMarkupSerializer<EditingStrategy>; |
| 493 template class StyledMarkupSerializer<EditingInComposedTreeStrategy>; | 497 template class StyledMarkupSerializer<EditingInComposedTreeStrategy>; |
| 494 | 498 |
| 495 } // namespace blink | 499 } // namespace blink |
| OLD | NEW |