| 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/css/CSSSyntaxDescriptor.h" | 7 #include "core/css/CSSSyntaxDescriptor.h" |
| 8 #include "core/css/CSSValueList.h" | 8 #include "core/css/CSSValueList.h" |
| 9 #include "core/css/CSSVariableReferenceValue.h" | 9 #include "core/css/CSSVariableReferenceValue.h" |
| 10 #include "core/css/PropertyDescriptor.h" | 10 #include "core/css/PropertyDescriptor.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 primitiveValue.accumulateLengthArray(lengthArray); | 43 primitiveValue.accumulateLengthArray(lengthArray); |
| 44 for (size_t i = 0; i < lengthArray.values.size(); i++) { | 44 for (size_t i = 0; i < lengthArray.values.size(); i++) { |
| 45 if (lengthArray.typeFlags.get(i) && | 45 if (lengthArray.typeFlags.get(i) && |
| 46 i != CSSPrimitiveValue::UnitTypePixels && | 46 i != CSSPrimitiveValue::UnitTypePixels && |
| 47 i != CSSPrimitiveValue::UnitTypePercentage) | 47 i != CSSPrimitiveValue::UnitTypePercentage) |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 // TODO(timloh): Images and transform-function values can also contain lengths
. | 53 // TODO(timloh): Images and transform-function values can also contain |
| 54 // lengths. |
| 54 | 55 |
| 55 return true; | 56 return true; |
| 56 } | 57 } |
| 57 | 58 |
| 58 void PropertyRegistration::registerProperty( | 59 void PropertyRegistration::registerProperty( |
| 59 ExecutionContext* executionContext, | 60 ExecutionContext* executionContext, |
| 60 const PropertyDescriptor& descriptor, | 61 const PropertyDescriptor& descriptor, |
| 61 ExceptionState& exceptionState) { | 62 ExceptionState& exceptionState) { |
| 62 // Bindings code ensures these are set. | 63 // Bindings code ensures these are set. |
| 63 DCHECK(descriptor.hasName()); | 64 DCHECK(descriptor.hasName()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return; | 141 return; |
| 141 } | 142 } |
| 142 registry.unregisterProperty(atomicProperty); | 143 registry.unregisterProperty(atomicProperty); |
| 143 | 144 |
| 144 document->setNeedsStyleRecalc(SubtreeStyleChange, | 145 document->setNeedsStyleRecalc(SubtreeStyleChange, |
| 145 StyleChangeReasonForTracing::create( | 146 StyleChangeReasonForTracing::create( |
| 146 StyleChangeReason::PropertyUnregistration)); | 147 StyleChangeReason::PropertyUnregistration)); |
| 147 } | 148 } |
| 148 | 149 |
| 149 } // namespace blink | 150 } // namespace blink |
| OLD | NEW |