Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp

Issue 2687243002: Rename the methods in EditingStyleUtilities class and make them used in editing (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698