| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 * rights reserved. | 6 * rights reserved. |
| 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 #include "platform/graphics/Color.h" | 79 #include "platform/graphics/Color.h" |
| 80 #include "platform/graphics/TouchAction.h" | 80 #include "platform/graphics/TouchAction.h" |
| 81 #include "platform/heap/Handle.h" | 81 #include "platform/heap/Handle.h" |
| 82 #include "platform/scroll/ScrollTypes.h" | 82 #include "platform/scroll/ScrollTypes.h" |
| 83 #include "platform/text/TabSize.h" | 83 #include "platform/text/TabSize.h" |
| 84 #include "platform/text/TextDirection.h" | 84 #include "platform/text/TextDirection.h" |
| 85 #include "platform/text/UnicodeBidi.h" | 85 #include "platform/text/UnicodeBidi.h" |
| 86 #include "platform/transforms/TransformOperations.h" | 86 #include "platform/transforms/TransformOperations.h" |
| 87 #include "platform/wtf/Forward.h" | 87 #include "platform/wtf/Forward.h" |
| 88 #include "platform/wtf/LeakAnnotations.h" | 88 #include "platform/wtf/LeakAnnotations.h" |
| 89 #include "platform/wtf/PassRefPtr.h" | |
| 90 #include "platform/wtf/RefCounted.h" | 89 #include "platform/wtf/RefCounted.h" |
| 91 #include "platform/wtf/RefVector.h" | 90 #include "platform/wtf/RefVector.h" |
| 92 #include "platform/wtf/Vector.h" | 91 #include "platform/wtf/Vector.h" |
| 93 #include "platform/wtf/text/AtomicString.h" | 92 #include "platform/wtf/text/AtomicString.h" |
| 94 | 93 |
| 95 template <typename T, typename U> | 94 template <typename T, typename U> |
| 96 inline bool compareEqual(const T& t, const U& u) { | 95 inline bool compareEqual(const T& t, const U& u) { |
| 97 return t == static_cast<T>(u); | 96 return t == static_cast<T>(u); |
| 98 } | 97 } |
| 99 | 98 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // list of associated pseudo styles | 246 // list of associated pseudo styles |
| 248 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; | 247 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; |
| 249 | 248 |
| 250 DataRef<SVGComputedStyle> svg_style_; | 249 DataRef<SVGComputedStyle> svg_style_; |
| 251 | 250 |
| 252 private: | 251 private: |
| 253 // TODO(sashab): Move these private members to the bottom of ComputedStyle. | 252 // TODO(sashab): Move these private members to the bottom of ComputedStyle. |
| 254 ALWAYS_INLINE ComputedStyle(); | 253 ALWAYS_INLINE ComputedStyle(); |
| 255 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); | 254 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); |
| 256 | 255 |
| 257 static PassRefPtr<ComputedStyle> CreateInitialStyle(); | 256 static RefPtr<ComputedStyle> CreateInitialStyle(); |
| 258 // TODO(shend): Remove this. Initial style should not be mutable. | 257 // TODO(shend): Remove this. Initial style should not be mutable. |
| 259 static ComputedStyle& MutableInitialStyle(); | 258 static ComputedStyle& MutableInitialStyle(); |
| 260 | 259 |
| 261 public: | 260 public: |
| 262 static PassRefPtr<ComputedStyle> Create(); | 261 static RefPtr<ComputedStyle> Create(); |
| 263 static PassRefPtr<ComputedStyle> CreateAnonymousStyleWithDisplay( | 262 static RefPtr<ComputedStyle> CreateAnonymousStyleWithDisplay( |
| 264 const ComputedStyle& parent_style, | 263 const ComputedStyle& parent_style, |
| 265 EDisplay); | 264 EDisplay); |
| 266 static PassRefPtr<ComputedStyle> Clone(const ComputedStyle&); | 265 static RefPtr<ComputedStyle> Clone(const ComputedStyle&); |
| 267 static const ComputedStyle& InitialStyle() { return MutableInitialStyle(); } | 266 static const ComputedStyle& InitialStyle() { return MutableInitialStyle(); } |
| 268 static void InvalidateInitialStyle(); | 267 static void InvalidateInitialStyle(); |
| 269 | 268 |
| 270 // Computes how the style change should be propagated down the tree. | 269 // Computes how the style change should be propagated down the tree. |
| 271 static StyleRecalcChange StylePropagationDiff(const ComputedStyle* old_style, | 270 static StyleRecalcChange StylePropagationDiff(const ComputedStyle* old_style, |
| 272 const ComputedStyle* new_style); | 271 const ComputedStyle* new_style); |
| 273 | 272 |
| 274 // Copies the values of any independent inherited properties from the parent | 273 // Copies the values of any independent inherited properties from the parent |
| 275 // that are not explicitly set in this style. | 274 // that are not explicitly set in this style. |
| 276 void PropagateIndependentInheritedProperties( | 275 void PropagateIndependentInheritedProperties( |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 // -webkit-transform-origin-z | 1290 // -webkit-transform-origin-z |
| 1292 static float InitialTransformOriginZ() { return 0; } | 1291 static float InitialTransformOriginZ() { return 0; } |
| 1293 float TransformOriginZ() const { return GetTransformOrigin().Z(); } | 1292 float TransformOriginZ() const { return GetTransformOrigin().Z(); } |
| 1294 void SetTransformOriginZ(float f) { | 1293 void SetTransformOriginZ(float f) { |
| 1295 SetTransformOrigin( | 1294 SetTransformOrigin( |
| 1296 TransformOrigin(TransformOriginX(), TransformOriginY(), f)); | 1295 TransformOrigin(TransformOriginX(), TransformOriginY(), f)); |
| 1297 } | 1296 } |
| 1298 | 1297 |
| 1299 // Independent transform properties. | 1298 // Independent transform properties. |
| 1300 // translate | 1299 // translate |
| 1301 static PassRefPtr<TranslateTransformOperation> InitialTranslate() { | 1300 static RefPtr<TranslateTransformOperation> InitialTranslate() { |
| 1302 return nullptr; | 1301 return nullptr; |
| 1303 } | 1302 } |
| 1304 TranslateTransformOperation* Translate() const { | 1303 TranslateTransformOperation* Translate() const { |
| 1305 return rare_non_inherited_data_->transform_->translate_.Get(); | 1304 return rare_non_inherited_data_->transform_->translate_.Get(); |
| 1306 } | 1305 } |
| 1307 void SetTranslate(RefPtr<TranslateTransformOperation> v) { | 1306 void SetTranslate(RefPtr<TranslateTransformOperation> v) { |
| 1308 rare_non_inherited_data_.Access()->transform_.Access()->translate_ = | 1307 rare_non_inherited_data_.Access()->transform_.Access()->translate_ = |
| 1309 std::move(v); | 1308 std::move(v); |
| 1310 } | 1309 } |
| 1311 | 1310 |
| 1312 // rotate | 1311 // rotate |
| 1313 static PassRefPtr<RotateTransformOperation> InitialRotate() { | 1312 static RefPtr<RotateTransformOperation> InitialRotate() { return nullptr; } |
| 1314 return nullptr; | |
| 1315 } | |
| 1316 RotateTransformOperation* Rotate() const { | 1313 RotateTransformOperation* Rotate() const { |
| 1317 return rare_non_inherited_data_->transform_->rotate_.Get(); | 1314 return rare_non_inherited_data_->transform_->rotate_.Get(); |
| 1318 } | 1315 } |
| 1319 void SetRotate(RefPtr<RotateTransformOperation> v) { | 1316 void SetRotate(RefPtr<RotateTransformOperation> v) { |
| 1320 rare_non_inherited_data_.Access()->transform_.Access()->rotate_ = | 1317 rare_non_inherited_data_.Access()->transform_.Access()->rotate_ = |
| 1321 std::move(v); | 1318 std::move(v); |
| 1322 } | 1319 } |
| 1323 | 1320 |
| 1324 // scale | 1321 // scale |
| 1325 static PassRefPtr<ScaleTransformOperation> InitialScale() { return nullptr; } | 1322 static RefPtr<ScaleTransformOperation> InitialScale() { return nullptr; } |
| 1326 ScaleTransformOperation* Scale() const { | 1323 ScaleTransformOperation* Scale() const { |
| 1327 return rare_non_inherited_data_->transform_->scale_.Get(); | 1324 return rare_non_inherited_data_->transform_->scale_.Get(); |
| 1328 } | 1325 } |
| 1329 void SetScale(RefPtr<ScaleTransformOperation> v) { | 1326 void SetScale(RefPtr<ScaleTransformOperation> v) { |
| 1330 rare_non_inherited_data_.Access()->transform_.Access()->scale_ = | 1327 rare_non_inherited_data_.Access()->transform_.Access()->scale_ = |
| 1331 std::move(v); | 1328 std::move(v); |
| 1332 } | 1329 } |
| 1333 | 1330 |
| 1334 // Scroll properties. | 1331 // Scroll properties. |
| 1335 // scroll-behavior | 1332 // scroll-behavior |
| (...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3779 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3776 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
| 3780 } | 3777 } |
| 3781 | 3778 |
| 3782 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3779 inline bool ComputedStyle::HasPseudoElementStyle() const { |
| 3783 return PseudoBitsInternal() & kElementPseudoIdMask; | 3780 return PseudoBitsInternal() & kElementPseudoIdMask; |
| 3784 } | 3781 } |
| 3785 | 3782 |
| 3786 } // namespace blink | 3783 } // namespace blink |
| 3787 | 3784 |
| 3788 #endif // ComputedStyle_h | 3785 #endif // ComputedStyle_h |
| OLD | NEW |