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 18 matching lines...) Expand all Loading... |
29 #include "core/css/CSSColorValue.h" | 29 #include "core/css/CSSColorValue.h" |
30 #include "core/css/CSSComputedStyleDeclaration.h" | 30 #include "core/css/CSSComputedStyleDeclaration.h" |
31 #include "core/css/CSSIdentifierValue.h" | 31 #include "core/css/CSSIdentifierValue.h" |
32 #include "core/css/StylePropertySet.h" | 32 #include "core/css/StylePropertySet.h" |
33 #include "core/css/parser/CSSParser.h" | 33 #include "core/css/parser/CSSParser.h" |
34 #include "core/editing/EditingStyle.h" | 34 #include "core/editing/EditingStyle.h" |
35 #include "core/editing/EditingUtilities.h" | 35 #include "core/editing/EditingUtilities.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
| 39 using namespace cssvalue; |
| 40 |
39 bool EditingStyleUtilities::hasAncestorVerticalAlignStyle(Node& node, | 41 bool EditingStyleUtilities::hasAncestorVerticalAlignStyle(Node& node, |
40 CSSValueID value) { | 42 CSSValueID value) { |
41 for (Node& runner : NodeTraversal::inclusiveAncestorsOf(node)) { | 43 for (Node& runner : NodeTraversal::inclusiveAncestorsOf(node)) { |
42 CSSComputedStyleDeclaration* ancestorStyle = | 44 CSSComputedStyleDeclaration* ancestorStyle = |
43 CSSComputedStyleDeclaration::create(&runner); | 45 CSSComputedStyleDeclaration::create(&runner); |
44 if (getIdentifierValue(ancestorStyle, CSSPropertyVerticalAlign) == value) | 46 if (getIdentifierValue(ancestorStyle, CSSPropertyVerticalAlign) == value) |
45 return true; | 47 return true; |
46 } | 48 } |
47 return false; | 49 return false; |
48 } | 50 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 191 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
190 CSSComputedStyleDeclaration* ancestorStyle = | 192 CSSComputedStyleDeclaration* ancestorStyle = |
191 CSSComputedStyleDeclaration::create(ancestor); | 193 CSSComputedStyleDeclaration::create(ancestor); |
192 if (!hasTransparentBackgroundColor(ancestorStyle)) | 194 if (!hasTransparentBackgroundColor(ancestorStyle)) |
193 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor); | 195 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor); |
194 } | 196 } |
195 return nullptr; | 197 return nullptr; |
196 } | 198 } |
197 | 199 |
198 } // namespace blink | 200 } // namespace blink |
OLD | NEW |