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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 return removed; | 874 return removed; |
875 } | 875 } |
876 | 876 |
877 bool EditingStyle::styleIsPresentInComputedStyleOfNode(Node* node) const | 877 bool EditingStyle::styleIsPresentInComputedStyleOfNode(Node* node) const |
878 { | 878 { |
879 return !m_mutableStyle || getPropertiesNotIn(m_mutableStyle.get(), CSSComput
edStyleDeclaration::create(node).get())->isEmpty(); | 879 return !m_mutableStyle || getPropertiesNotIn(m_mutableStyle.get(), CSSComput
edStyleDeclaration::create(node).get())->isEmpty(); |
880 } | 880 } |
881 | 881 |
882 bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* elemen
t) | 882 bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* elemen
t) |
883 { | 883 { |
| 884 ASSERT(element); |
884 bool elementIsSpanOrElementEquivalent = false; | 885 bool elementIsSpanOrElementEquivalent = false; |
885 if (element->hasTagName(HTMLNames::spanTag)) | 886 if (isHTMLSpanElement(*element)) |
886 elementIsSpanOrElementEquivalent = true; | 887 elementIsSpanOrElementEquivalent = true; |
887 else { | 888 else { |
888 const Vector<OwnPtr<HTMLElementEquivalent> >& HTMLElementEquivalents = h
tmlElementEquivalents(); | 889 const Vector<OwnPtr<HTMLElementEquivalent> >& HTMLElementEquivalents = h
tmlElementEquivalents(); |
889 size_t i; | 890 size_t i; |
890 for (i = 0; i < HTMLElementEquivalents.size(); ++i) { | 891 for (i = 0; i < HTMLElementEquivalents.size(); ++i) { |
891 if (HTMLElementEquivalents[i]->matches(element)) { | 892 if (HTMLElementEquivalents[i]->matches(element)) { |
892 elementIsSpanOrElementEquivalent = true; | 893 elementIsSpanOrElementEquivalent = true; |
893 break; | 894 break; |
894 } | 895 } |
895 } | 896 } |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 { | 1634 { |
1634 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1635 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
1635 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); | 1636 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); |
1636 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1637 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
1637 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1638 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
1638 } | 1639 } |
1639 return nullptr; | 1640 return nullptr; |
1640 } | 1641 } |
1641 | 1642 |
1642 } | 1643 } |
OLD | NEW |