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

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

Issue 940373003: Rename RenderText to LayoutText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « Source/core/dom/Text.cpp ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | 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) 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 29 matching lines...) Expand all
40 #include "core/editing/EditingStyle.h" 40 #include "core/editing/EditingStyle.h"
41 #include "core/editing/HTMLInterchange.h" 41 #include "core/editing/HTMLInterchange.h"
42 #include "core/editing/PlainTextRange.h" 42 #include "core/editing/PlainTextRange.h"
43 #include "core/editing/VisibleUnits.h" 43 #include "core/editing/VisibleUnits.h"
44 #include "core/editing/htmlediting.h" 44 #include "core/editing/htmlediting.h"
45 #include "core/editing/iterators/TextIterator.h" 45 #include "core/editing/iterators/TextIterator.h"
46 #include "core/frame/UseCounter.h" 46 #include "core/frame/UseCounter.h"
47 #include "core/html/HTMLFontElement.h" 47 #include "core/html/HTMLFontElement.h"
48 #include "core/html/HTMLSpanElement.h" 48 #include "core/html/HTMLSpanElement.h"
49 #include "core/layout/LayoutObject.h" 49 #include "core/layout/LayoutObject.h"
50 #include "core/rendering/RenderText.h" 50 #include "core/layout/LayoutText.h"
51 #include "platform/heap/Handle.h" 51 #include "platform/heap/Handle.h"
52 #include "wtf/StdLibExtras.h" 52 #include "wtf/StdLibExtras.h"
53 #include "wtf/text/StringBuilder.h" 53 #include "wtf/text/StringBuilder.h"
54 54
55 namespace blink { 55 namespace blink {
56 56
57 using namespace HTMLNames; 57 using namespace HTMLNames;
58 58
59 static String& styleSpanClassString() 59 static String& styleSpanClassString()
60 { 60 {
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 newInlineStyle->mergeInlineStyleOfElement(toHTMLElement(node), EditingSt yle::OverrideValues); 1033 newInlineStyle->mergeInlineStyleOfElement(toHTMLElement(node), EditingSt yle::OverrideValues);
1034 } 1034 }
1035 1035
1036 // Since addInlineStyleIfNeeded can't add styles to block-flow render object s, add style attribute instead. 1036 // Since addInlineStyleIfNeeded can't add styles to block-flow render object s, add style attribute instead.
1037 // FIXME: applyInlineStyleToRange should be used here instead. 1037 // FIXME: applyInlineStyleToRange should be used here instead.
1038 if ((node->renderer()->isLayoutBlockFlow() || node->hasChildren()) && node-> isHTMLElement()) { 1038 if ((node->renderer()->isLayoutBlockFlow() || node->hasChildren()) && node-> isHTMLElement()) {
1039 setNodeAttribute(toHTMLElement(node), styleAttr, AtomicString(newInlineS tyle->style()->asText())); 1039 setNodeAttribute(toHTMLElement(node), styleAttr, AtomicString(newInlineS tyle->style()->asText()));
1040 return; 1040 return;
1041 } 1041 }
1042 1042
1043 if (node->renderer()->isText() && toRenderText(node->renderer())->isAllColla psibleWhitespace()) 1043 if (node->renderer()->isText() && toLayoutText(node->renderer())->isAllColla psibleWhitespace())
1044 return; 1044 return;
1045 1045
1046 // We can't wrap node with the styled element here because new styled elemen t will never be removed if we did. 1046 // We can't wrap node with the styled element here because new styled elemen t will never be removed if we did.
1047 // If we modified the child pointer in pushDownInlineStyleAroundNode to poin t to new style element 1047 // If we modified the child pointer in pushDownInlineStyleAroundNode to poin t to new style element
1048 // then we fall into an infinite loop where we keep removing and adding styl ed element wrapping node. 1048 // then we fall into an infinite loop where we keep removing and adding styl ed element wrapping node.
1049 addInlineStyleIfNeeded(newInlineStyle.get(), node, node, DoNotAddStyledEleme nt); 1049 addInlineStyleIfNeeded(newInlineStyle.get(), node, node, DoNotAddStyledEleme nt);
1050 } 1050 }
1051 1051
1052 void ApplyStyleCommand::pushDownInlineStyleAroundNode(EditingStyle* style, Node* targetNode) 1052 void ApplyStyleCommand::pushDownInlineStyleAroundNode(EditingStyle* style, Node* targetNode)
1053 { 1053 {
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 DEFINE_TRACE(ApplyStyleCommand) 1586 DEFINE_TRACE(ApplyStyleCommand)
1587 { 1587 {
1588 visitor->trace(m_style); 1588 visitor->trace(m_style);
1589 visitor->trace(m_start); 1589 visitor->trace(m_start);
1590 visitor->trace(m_end); 1590 visitor->trace(m_end);
1591 visitor->trace(m_styledInlineElement); 1591 visitor->trace(m_styledInlineElement);
1592 CompositeEditCommand::trace(visitor); 1592 CompositeEditCommand::trace(visitor);
1593 } 1593 }
1594 1594
1595 } 1595 }
OLDNEW
« no previous file with comments | « Source/core/dom/Text.cpp ('k') | Source/core/editing/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698