OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |