| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/PropertyRegistration.h" | 5 #include "core/css/PropertyRegistration.h" |
| 6 | 6 |
| 7 #include "core/animation/CSSInterpolationTypesMap.h" | 7 #include "core/animation/CSSInterpolationTypesMap.h" |
| 8 #include "core/css/CSSStyleSheet.h" | 8 #include "core/css/CSSStyleSheet.h" |
| 9 #include "core/css/CSSSyntaxDescriptor.h" | 9 #include "core/css/CSSSyntaxDescriptor.h" |
| 10 #include "core/css/CSSValueList.h" | 10 #include "core/css/CSSValueList.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 primitive_value.AccumulateLengthArray(length_array); | 73 primitive_value.AccumulateLengthArray(length_array); |
| 74 for (size_t i = 0; i < length_array.values.size(); i++) { | 74 for (size_t i = 0; i < length_array.values.size(); i++) { |
| 75 if (length_array.type_flags.Get(i) && | 75 if (length_array.type_flags.Get(i) && |
| 76 i != CSSPrimitiveValue::kUnitTypePixels && | 76 i != CSSPrimitiveValue::kUnitTypePixels && |
| 77 i != CSSPrimitiveValue::kUnitTypePercentage) | 77 i != CSSPrimitiveValue::kUnitTypePercentage) |
| 78 return false; | 78 return false; |
| 79 } | 79 } |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 // TODO(timloh): Images and transform-function values can also contain | 83 // TODO(timloh): Images values can also contain lengths. |
| 84 // lengths. | |
| 85 | 84 |
| 86 return true; | 85 return true; |
| 87 } | 86 } |
| 88 | 87 |
| 89 void PropertyRegistration::registerProperty( | 88 void PropertyRegistration::registerProperty( |
| 90 ExecutionContext* execution_context, | 89 ExecutionContext* execution_context, |
| 91 const PropertyDescriptor& descriptor, | 90 const PropertyDescriptor& descriptor, |
| 92 ExceptionState& exception_state) { | 91 ExceptionState& exception_state) { |
| 93 // Bindings code ensures these are set. | 92 // Bindings code ensures these are set. |
| 94 DCHECK(descriptor.hasName()); | 93 DCHECK(descriptor.hasName()); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 std::move(css_interpolation_types)); | 160 std::move(css_interpolation_types)); |
| 162 } | 161 } |
| 163 | 162 |
| 164 // TODO(timloh): Invalidate only elements with this custom property set | 163 // TODO(timloh): Invalidate only elements with this custom property set |
| 165 document->SetNeedsStyleRecalc(kSubtreeStyleChange, | 164 document->SetNeedsStyleRecalc(kSubtreeStyleChange, |
| 166 StyleChangeReasonForTracing::Create( | 165 StyleChangeReasonForTracing::Create( |
| 167 StyleChangeReason::kPropertyRegistration)); | 166 StyleChangeReason::kPropertyRegistration)); |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace blink | 169 } // namespace blink |
| OLD | NEW |