| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. | 4 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. |
| 5 * Copyright (C) 2011 Igalia S.L. | 5 * Copyright (C) 2011 Igalia S.L. |
| 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/editing/serializers/StyledMarkupSerializer.h" | 30 #include "core/editing/serializers/StyledMarkupSerializer.h" |
| 31 | 31 |
| 32 #include "core/css/StylePropertySet.h" | 32 #include "core/css/StylePropertySet.h" |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/dom/Element.h" | 34 #include "core/dom/Element.h" |
| 35 #include "core/dom/Text.h" | 35 #include "core/dom/Text.h" |
| 36 #include "core/dom/shadow/ElementShadow.h" | 36 #include "core/dom/shadow/ElementShadow.h" |
| 37 #include "core/editing/EditingStyle.h" | 37 #include "core/editing/EditingStyle.h" |
| 38 #include "core/editing/EditingStyleUtilities.h" |
| 38 #include "core/editing/EditingUtilities.h" | 39 #include "core/editing/EditingUtilities.h" |
| 39 #include "core/editing/VisibleSelection.h" | 40 #include "core/editing/VisibleSelection.h" |
| 40 #include "core/editing/VisibleUnits.h" | 41 #include "core/editing/VisibleUnits.h" |
| 41 #include "core/editing/serializers/Serialization.h" | 42 #include "core/editing/serializers/Serialization.h" |
| 42 #include "core/html/HTMLBodyElement.h" | 43 #include "core/html/HTMLBodyElement.h" |
| 43 #include "core/html/HTMLElement.h" | 44 #include "core/html/HTMLElement.h" |
| 44 #include "wtf/text/StringBuilder.h" | 45 #include "wtf/text/StringBuilder.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 DCHECK_EQ(m_lastClosed, static_cast<decltype(m_lastClosed)>(nullptr)); | 316 DCHECK_EQ(m_lastClosed, static_cast<decltype(m_lastClosed)>(nullptr)); |
| 316 return; | 317 return; |
| 317 } | 318 } |
| 318 if (!m_lastClosed) | 319 if (!m_lastClosed) |
| 319 return; | 320 return; |
| 320 ContainerNode* parent = Strategy::parent(*m_lastClosed); | 321 ContainerNode* parent = Strategy::parent(*m_lastClosed); |
| 321 if (!parent) | 322 if (!parent) |
| 322 return; | 323 return; |
| 323 if (shouldAnnotate()) { | 324 if (shouldAnnotate()) { |
| 324 m_wrappingStyle = | 325 m_wrappingStyle = |
| 325 EditingStyle::wrappingStyleForAnnotatedSerialization(parent); | 326 EditingStyleUtilities::createWrappingStyleForAnnotatedSerialization( |
| 327 parent); |
| 326 return; | 328 return; |
| 327 } | 329 } |
| 328 m_wrappingStyle = EditingStyle::wrappingStyleForSerialization(parent); | 330 m_wrappingStyle = |
| 331 EditingStyleUtilities::createWrappingStyleForSerialization(parent); |
| 329 } | 332 } |
| 330 | 333 |
| 331 template <typename Strategy> | 334 template <typename Strategy> |
| 332 Node* StyledMarkupTraverser<Strategy>::traverse(Node* startNode, | 335 Node* StyledMarkupTraverser<Strategy>::traverse(Node* startNode, |
| 333 Node* pastEnd) { | 336 Node* pastEnd) { |
| 334 HeapVector<Member<ContainerNode>> ancestorsToClose; | 337 HeapVector<Member<ContainerNode>> ancestorsToClose; |
| 335 Node* next; | 338 Node* next; |
| 336 Node* lastClosed = nullptr; | 339 Node* lastClosed = nullptr; |
| 337 for (Node* n = startNode; n && n != pastEnd; n = next) { | 340 for (Node* n = startNode; n && n != pastEnd; n = next) { |
| 338 // If |n| is a selection boundary such as <input>, traverse the child | 341 // If |n| is a selection boundary such as <input>, traverse the child |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 if (element.isHTMLElement() && shouldAnnotate()) | 541 if (element.isHTMLElement() && shouldAnnotate()) |
| 539 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); | 542 inlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element)); |
| 540 | 543 |
| 541 return inlineStyle; | 544 return inlineStyle; |
| 542 } | 545 } |
| 543 | 546 |
| 544 template class StyledMarkupSerializer<EditingStrategy>; | 547 template class StyledMarkupSerializer<EditingStrategy>; |
| 545 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; | 548 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; |
| 546 | 549 |
| 547 } // namespace blink | 550 } // namespace blink |
| OLD | NEW |