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

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

Issue 2105653004: Remove redundant isInline function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/EditingUtilities.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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 if (!node || !node->isHTMLElement()) 47 if (!node || !node->isHTMLElement())
48 return false; 48 return false;
49 if (!node->layoutObject() || !node->layoutObject()->isLayoutBlock()) 49 if (!node->layoutObject() || !node->layoutObject()->isLayoutBlock())
50 return false; 50 return false;
51 const HTMLElement& element = toHTMLElement(*node); 51 const HTMLElement& element = toHTMLElement(*node);
52 // TODO(yosin): We should check OL/UL element has "list-style-type" CSS 52 // TODO(yosin): We should check OL/UL element has "list-style-type" CSS
53 // property to make sure they layout contents as list. 53 // property to make sure they layout contents as list.
54 return isHTMLUListElement(element) || isHTMLOListElement(element) || element .hasTagName(blockquoteTag); 54 return isHTMLUListElement(element) || isHTMLOListElement(element) || element .hasTagName(blockquoteTag);
55 } 55 }
56 56
57 static bool isInline(const Node* node)
58 {
59 return node && node->layoutObject() && node->layoutObject()->isInline();
60 }
61
62
63 IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeO fAction) 57 IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeO fAction)
64 : ApplyBlockElementCommand(document, blockquoteTag, "margin: 0 0 0 40px; bor der: none; padding: 0px;") 58 : ApplyBlockElementCommand(document, blockquoteTag, "margin: 0 0 0 40px; bor der: none; padding: 0px;")
65 , m_typeOfAction(typeOfAction) 59 , m_typeOfAction(typeOfAction)
66 { 60 {
67 } 61 }
68 62
69 bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P osition& end, EditingState* editingState) 63 bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P osition& end, EditingState* editingState)
70 { 64 {
71 // If our selection is not inside a list, bail out. 65 // If our selection is not inside a list, bail out.
72 Node* lastNodeInSelectedParagraph = start.anchorNode(); 66 Node* lastNodeInSelectedParagraph = start.anchorNode();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingS tate); 280 bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingS tate);
287 if (editingState->isAborted()) 281 if (editingState->isAborted())
288 return; 282 return;
289 if (indentingAsListItemResult) 283 if (indentingAsListItemResult)
290 blockquoteForNextIndent = nullptr; 284 blockquoteForNextIndent = nullptr;
291 else 285 else
292 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState); 286 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState);
293 } 287 }
294 288
295 } // namespace blink 289 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698