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

Side by Side Diff: Source/core/editing/commands/ApplyStyleCommand.cpp

Issue 1320573003: Rename isBlock() to isEnclosingBlock() in EditingUtilities (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-26T21:48:03 Rebase Created 5 years, 3 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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 // Add to this element's inline style and skip over its contents. 805 // Add to this element's inline style and skip over its contents.
806 next = NodeTraversal::nextSkippingChildren(*node); 806 next = NodeTraversal::nextSkippingChildren(*node);
807 if (!style->style()) 807 if (!style->style())
808 continue; 808 continue;
809 RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleO rCreateEmpty(element->inlineStyle()); 809 RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleO rCreateEmpty(element->inlineStyle());
810 inlineStyle->mergeAndOverrideOnConflict(style->style()); 810 inlineStyle->mergeAndOverrideOnConflict(style->style());
811 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex t())); 811 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex t()));
812 continue; 812 continue;
813 } 813 }
814 814
815 if (isBlock(node.get())) 815 if (isEnclosingBlock(node.get()))
816 continue; 816 continue;
817 817
818 if (node->hasChildren()) { 818 if (node->hasChildren()) {
819 if (node->contains(pastEndNode.get()) || containsNonEditableRegion(* node) || !node->parentNode()->hasEditableStyle()) 819 if (node->contains(pastEndNode.get()) || containsNonEditableRegion(* node) || !node->parentNode()->hasEditableStyle())
820 continue; 820 continue;
821 if (editingIgnoresContent(node.get())) { 821 if (editingIgnoresContent(node.get())) {
822 next = NodeTraversal::nextSkippingChildren(*node); 822 next = NodeTraversal::nextSkippingChildren(*node);
823 continue; 823 continue;
824 } 824 }
825 } 825 }
826 826
827 Node* runStart = node.get(); 827 Node* runStart = node.get();
828 Node* runEnd = node.get(); 828 Node* runEnd = node.get();
829 Node* sibling = node->nextSibling(); 829 Node* sibling = node->nextSibling();
830 while (sibling && sibling != pastEndNode && !sibling->contains(pastEndNo de.get()) 830 while (sibling && sibling != pastEndNode && !sibling->contains(pastEndNo de.get())
831 && (!isBlock(sibling) || isHTMLBRElement(*sibling)) 831 && (!isEnclosingBlock(sibling) || isHTMLBRElement(*sibling))
832 && !containsNonEditableRegion(*sibling)) { 832 && !containsNonEditableRegion(*sibling)) {
833 runEnd = sibling; 833 runEnd = sibling;
834 sibling = runEnd->nextSibling(); 834 sibling = runEnd->nextSibling();
835 } 835 }
836 ASSERT(runEnd); 836 ASSERT(runEnd);
837 next = NodeTraversal::nextSkippingChildren(*runEnd); 837 next = NodeTraversal::nextSkippingChildren(*runEnd);
838 838
839 Node* pastEndNode = NodeTraversal::nextSkippingChildren(*runEnd); 839 Node* pastEndNode = NodeTraversal::nextSkippingChildren(*runEnd);
840 if (!shouldApplyInlineStyleToRun(style, runStart, pastEndNode)) 840 if (!shouldApplyInlineStyleToRun(style, runStart, pastEndNode))
841 continue; 841 continue;
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 DEFINE_TRACE(ApplyStyleCommand) 1594 DEFINE_TRACE(ApplyStyleCommand)
1595 { 1595 {
1596 visitor->trace(m_style); 1596 visitor->trace(m_style);
1597 visitor->trace(m_start); 1597 visitor->trace(m_start);
1598 visitor->trace(m_end); 1598 visitor->trace(m_end);
1599 visitor->trace(m_styledInlineElement); 1599 visitor->trace(m_styledInlineElement);
1600 CompositeEditCommand::trace(visitor); 1600 CompositeEditCommand::trace(visitor);
1601 } 1601 }
1602 1602
1603 } 1603 }
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698