OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. | 2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. |
3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 unsigned propertyCount = style->propertyCount(); | 926 unsigned propertyCount = style->propertyCount(); |
927 for (unsigned i = 0; i < propertyCount; ++i) { | 927 for (unsigned i = 0; i < propertyCount; ++i) { |
928 if (!isEditingProperty(style->propertyAt(i).id())) | 928 if (!isEditingProperty(style->propertyAt(i).id())) |
929 return false; | 929 return false; |
930 } | 930 } |
931 } | 931 } |
932 matchedAttributes++; | 932 matchedAttributes++; |
933 } | 933 } |
934 | 934 |
935 // font with color attribute, span with style attribute, etc... | 935 // font with color attribute, span with style attribute, etc... |
936 ASSERT(matchedAttributes <= element->attributeCount()); | 936 ASSERT(matchedAttributes <= element->attributes().size()); |
937 return matchedAttributes >= element->attributeCount(); | 937 return matchedAttributes >= element->attributes().size(); |
938 } | 938 } |
939 | 939 |
940 void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit
ingDirection shouldPreserveWritingDirection) | 940 void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit
ingDirection shouldPreserveWritingDirection) |
941 { | 941 { |
942 if (!m_mutableStyle) | 942 if (!m_mutableStyle) |
943 return; | 943 return; |
944 | 944 |
945 // ReplaceSelectionCommand::handleStyleSpans() requires that this function o
nly removes the editing style. | 945 // ReplaceSelectionCommand::handleStyleSpans() requires that this function o
nly removes the editing style. |
946 // If this function was modified in the future to delete all redundant prope
rties, then add a boolean value to indicate | 946 // If this function was modified in the future to delete all redundant prope
rties, then add a boolean value to indicate |
947 // which one of editingStyleAtPosition or computedStyle is called. | 947 // which one of editingStyleAtPosition or computedStyle is called. |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 { | 1661 { |
1662 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1662 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
1663 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu
tedStyleDeclaration::create(ancestor); | 1663 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu
tedStyleDeclaration::create(ancestor); |
1664 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1664 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
1665 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1665 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
1666 } | 1666 } |
1667 return nullptr; | 1667 return nullptr; |
1668 } | 1668 } |
1669 | 1669 |
1670 } | 1670 } |
OLD | NEW |