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

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

Issue 357033002: Remove attributeCount() / attributeAt() API from Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/NamedNodeMap.cpp ('k') | Source/core/editing/EditingStyle.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (!element->hasAttributes()) 77 if (!element->hasAttributes())
78 return true; 78 return true;
79 79
80 unsigned matchedAttributes = 0; 80 unsigned matchedAttributes = 0;
81 if (element->getAttribute(classAttr) == styleSpanClassString()) 81 if (element->getAttribute(classAttr) == styleSpanClassString())
82 matchedAttributes++; 82 matchedAttributes++;
83 if (element->hasAttribute(styleAttr) && (shouldStyleAttributeBeEmpty == Allo wNonEmptyStyleAttribute 83 if (element->hasAttribute(styleAttr) && (shouldStyleAttributeBeEmpty == Allo wNonEmptyStyleAttribute
84 || !element->inlineStyle() || element->inlineStyle()->isEmpty())) 84 || !element->inlineStyle() || element->inlineStyle()->isEmpty()))
85 matchedAttributes++; 85 matchedAttributes++;
86 86
87 ASSERT(matchedAttributes <= element->attributeCount()); 87 ASSERT(matchedAttributes <= element->attributes().size());
88 return matchedAttributes == element->attributeCount(); 88 return matchedAttributes == element->attributes().size();
89 } 89 }
90 90
91 bool isStyleSpanOrSpanWithOnlyStyleAttribute(const Element* element) 91 bool isStyleSpanOrSpanWithOnlyStyleAttribute(const Element* element)
92 { 92 {
93 if (!isHTMLSpanElement(element)) 93 if (!isHTMLSpanElement(element))
94 return false; 94 return false;
95 return hasNoAttributeOrOnlyStyleAttribute(toHTMLElement(element), AllowNonEm ptyStyleAttribute); 95 return hasNoAttributeOrOnlyStyleAttribute(toHTMLElement(element), AllowNonEm ptyStyleAttribute);
96 } 96 }
97 97
98 static inline bool isSpanWithoutAttributesOrUnstyledStyleSpan(const Node* node) 98 static inline bool isSpanWithoutAttributesOrUnstyledStyleSpan(const Node* node)
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 void ApplyStyleCommand::trace(Visitor* visitor) 1572 void ApplyStyleCommand::trace(Visitor* visitor)
1573 { 1573 {
1574 visitor->trace(m_style); 1574 visitor->trace(m_style);
1575 visitor->trace(m_start); 1575 visitor->trace(m_start);
1576 visitor->trace(m_end); 1576 visitor->trace(m_end);
1577 visitor->trace(m_styledInlineElement); 1577 visitor->trace(m_styledInlineElement);
1578 CompositeEditCommand::trace(visitor); 1578 CompositeEditCommand::trace(visitor);
1579 } 1579 }
1580 1580
1581 } 1581 }
OLDNEW
« no previous file with comments | « Source/core/dom/NamedNodeMap.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698