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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp

Issue 2878333002: Make ETextModify an enum class. (Closed)
Patch Set: Created 3 years, 7 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) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 return; 1020 return;
1021 1021
1022 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 1022 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
1023 1023
1024 // We can skip matching the style if the selection is plain text. 1024 // We can skip matching the style if the selection is plain text.
1025 if ((selection.Start().AnchorNode()->GetLayoutObject() && 1025 if ((selection.Start().AnchorNode()->GetLayoutObject() &&
1026 selection.Start() 1026 selection.Start()
1027 .AnchorNode() 1027 .AnchorNode()
1028 ->GetLayoutObject() 1028 ->GetLayoutObject()
1029 ->Style() 1029 ->Style()
1030 ->UserModify() == READ_WRITE_PLAINTEXT_ONLY) && 1030 ->UserModify() == EUserModify::kReadWritePlaintextOnly) &&
1031 (selection.end().AnchorNode()->GetLayoutObject() && 1031 (selection.end().AnchorNode()->GetLayoutObject() &&
1032 selection.end().AnchorNode()->GetLayoutObject()->Style()->UserModify() == 1032 selection.end().AnchorNode()->GetLayoutObject()->Style()->UserModify() ==
1033 READ_WRITE_PLAINTEXT_ONLY)) 1033 EUserModify::kReadWritePlaintextOnly))
1034 match_style_ = false; 1034 match_style_ = false;
1035 1035
1036 if (match_style_) { 1036 if (match_style_) {
1037 insertion_style_ = EditingStyle::Create(selection.Start()); 1037 insertion_style_ = EditingStyle::Create(selection.Start());
1038 insertion_style_->MergeTypingStyle(&GetDocument()); 1038 insertion_style_->MergeTypingStyle(&GetDocument());
1039 } 1039 }
1040 1040
1041 const VisiblePosition visible_start = selection.VisibleStart(); 1041 const VisiblePosition visible_start = selection.VisibleStart();
1042 const VisiblePosition visible_end = selection.VisibleEnd(); 1042 const VisiblePosition visible_end = selection.VisibleEnd();
1043 1043
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 visitor->Trace(start_of_inserted_content_); 2009 visitor->Trace(start_of_inserted_content_);
2010 visitor->Trace(end_of_inserted_content_); 2010 visitor->Trace(end_of_inserted_content_);
2011 visitor->Trace(insertion_style_); 2011 visitor->Trace(insertion_style_);
2012 visitor->Trace(document_fragment_); 2012 visitor->Trace(document_fragment_);
2013 visitor->Trace(start_of_inserted_range_); 2013 visitor->Trace(start_of_inserted_range_);
2014 visitor->Trace(end_of_inserted_range_); 2014 visitor->Trace(end_of_inserted_range_);
2015 CompositeEditCommand::Trace(visitor); 2015 CompositeEditCommand::Trace(visitor);
2016 } 2016 }
2017 2017
2018 } // namespace blink 2018 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698