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

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

Issue 2952983002: Make Position::FirstPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-23T10:37:43 Created 3 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
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 StyledMarkupTraverser<Strategy> traverser(&markup_accumulator, last_closed_); 225 StyledMarkupTraverser<Strategy> traverser(&markup_accumulator, last_closed_);
226 Node* last_closed = traverser.Traverse(first_node, past_end); 226 Node* last_closed = traverser.Traverse(first_node, past_end);
227 227
228 if (highest_node_to_be_serialized_ && last_closed) { 228 if (highest_node_to_be_serialized_ && last_closed) {
229 // TODO(hajimehoshi): This is calculated at createMarkupInternal too. 229 // TODO(hajimehoshi): This is calculated at createMarkupInternal too.
230 Node* common_ancestor = Strategy::CommonAncestor( 230 Node* common_ancestor = Strategy::CommonAncestor(
231 *start_.ComputeContainerNode(), *end_.ComputeContainerNode()); 231 *start_.ComputeContainerNode(), *end_.ComputeContainerNode());
232 DCHECK(common_ancestor); 232 DCHECK(common_ancestor);
233 HTMLBodyElement* body = toHTMLBodyElement(EnclosingElementWithTag( 233 HTMLBodyElement* body = toHTMLBodyElement(EnclosingElementWithTag(
234 Position::FirstPositionInNode(common_ancestor), bodyTag)); 234 Position::FirstPositionInNode(*common_ancestor), bodyTag));
235 HTMLBodyElement* fully_selected_root = nullptr; 235 HTMLBodyElement* fully_selected_root = nullptr;
236 // FIXME: Do this for all fully selected blocks, not just the body. 236 // FIXME: Do this for all fully selected blocks, not just the body.
237 if (body && AreSameRanges(body, start_, end_)) 237 if (body && AreSameRanges(body, start_, end_))
238 fully_selected_root = body; 238 fully_selected_root = body;
239 239
240 // Also include all of the ancestors of lastClosed up to this special 240 // Also include all of the ancestors of lastClosed up to this special
241 // ancestor. 241 // ancestor.
242 // FIXME: What is ancestor? 242 // FIXME: What is ancestor?
243 for (ContainerNode* ancestor = Strategy::Parent(*last_closed); ancestor; 243 for (ContainerNode* ancestor = Strategy::Parent(*last_closed); ancestor;
244 ancestor = Strategy::Parent(*ancestor)) { 244 ancestor = Strategy::Parent(*ancestor)) {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 if (element.IsHTMLElement() && ShouldAnnotate()) 547 if (element.IsHTMLElement() && ShouldAnnotate())
548 inline_style->MergeStyleFromRulesForSerialization(&ToHTMLElement(element)); 548 inline_style->MergeStyleFromRulesForSerialization(&ToHTMLElement(element));
549 549
550 return inline_style; 550 return inline_style;
551 } 551 }
552 552
553 template class StyledMarkupSerializer<EditingStrategy>; 553 template class StyledMarkupSerializer<EditingStrategy>;
554 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>; 554 template class StyledMarkupSerializer<EditingInFlatTreeStrategy>;
555 555
556 } // namespace blink 556 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698