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

Side by Side Diff: Source/core/editing/StyledMarkupSerializer.cpp

Issue 1195813003: Refactoring: Remove a boolean parameter from EditingStyle::wrappingStyleForSerialization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comment 80 chars in a line Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/EditingStyle.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 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
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
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
OLDNEW
« no previous file with comments | « Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698