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 19 matching lines...) Expand all Loading... |
30 #include "core/CSSPropertyNames.h" | 30 #include "core/CSSPropertyNames.h" |
31 #include "core/ComputedStyleBase.h" | 31 #include "core/ComputedStyleBase.h" |
32 #include "core/CoreExport.h" | 32 #include "core/CoreExport.h" |
33 #include "core/style/BorderValue.h" | 33 #include "core/style/BorderValue.h" |
34 #include "core/style/ComputedStyleConstants.h" | 34 #include "core/style/ComputedStyleConstants.h" |
35 #include "core/style/CounterDirectives.h" | 35 #include "core/style/CounterDirectives.h" |
36 #include "core/style/DataRef.h" | 36 #include "core/style/DataRef.h" |
37 #include "core/style/LineClampValue.h" | 37 #include "core/style/LineClampValue.h" |
38 #include "core/style/NinePieceImage.h" | 38 #include "core/style/NinePieceImage.h" |
39 #include "core/style/SVGComputedStyle.h" | 39 #include "core/style/SVGComputedStyle.h" |
| 40 #include "core/style/StyleBackgroundData.h" |
40 #include "core/style/StyleBoxData.h" | 41 #include "core/style/StyleBoxData.h" |
41 #include "core/style/StyleContentAlignmentData.h" | 42 #include "core/style/StyleContentAlignmentData.h" |
42 #include "core/style/StyleDeprecatedFlexibleBoxData.h" | 43 #include "core/style/StyleDeprecatedFlexibleBoxData.h" |
43 #include "core/style/StyleDifference.h" | 44 #include "core/style/StyleDifference.h" |
44 #include "core/style/StyleFilterData.h" | 45 #include "core/style/StyleFilterData.h" |
45 #include "core/style/StyleFlexibleBoxData.h" | 46 #include "core/style/StyleFlexibleBoxData.h" |
46 #include "core/style/StyleGridData.h" | 47 #include "core/style/StyleGridData.h" |
47 #include "core/style/StyleGridItemData.h" | 48 #include "core/style/StyleGridItemData.h" |
48 #include "core/style/StyleInheritedData.h" | 49 #include "core/style/StyleInheritedData.h" |
49 #include "core/style/StyleMultiColData.h" | 50 #include "core/style/StyleMultiColData.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 friend class CSSToStyleMap; | 179 friend class CSSToStyleMap; |
179 friend class FilterOperationResolver; | 180 friend class FilterOperationResolver; |
180 friend class StyleBuilderConverter; | 181 friend class StyleBuilderConverter; |
181 friend class StyleResolverState; | 182 friend class StyleResolverState; |
182 friend class StyleResolver; | 183 friend class StyleResolver; |
183 | 184 |
184 protected: | 185 protected: |
185 // non-inherited attributes | 186 // non-inherited attributes |
186 DataRef<StyleBoxData> box_data_; | 187 DataRef<StyleBoxData> box_data_; |
187 DataRef<StyleVisualData> visual_data_; | 188 DataRef<StyleVisualData> visual_data_; |
| 189 DataRef<StyleBackgroundData> background_data_; |
188 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; | 190 DataRef<StyleRareNonInheritedData> rare_non_inherited_data_; |
189 | 191 |
190 // inherited attributes | 192 // inherited attributes |
191 DataRef<StyleRareInheritedData> rare_inherited_data_; | 193 DataRef<StyleRareInheritedData> rare_inherited_data_; |
192 DataRef<StyleInheritedData> style_inherited_data_; | 194 DataRef<StyleInheritedData> style_inherited_data_; |
193 | 195 |
194 // list of associated pseudo styles | 196 // list of associated pseudo styles |
195 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; | 197 std::unique_ptr<PseudoStyleCache> cached_pseudo_styles_; |
196 | 198 |
197 DataRef<SVGComputedStyle> svg_style_; | 199 DataRef<SVGComputedStyle> svg_style_; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 rare_non_inherited_data_->backface_visibility_); | 410 rare_non_inherited_data_->backface_visibility_); |
409 } | 411 } |
410 void SetBackfaceVisibility(EBackfaceVisibility b) { | 412 void SetBackfaceVisibility(EBackfaceVisibility b) { |
411 SET_VAR(rare_non_inherited_data_, backface_visibility_, b); | 413 SET_VAR(rare_non_inherited_data_, backface_visibility_, b); |
412 } | 414 } |
413 | 415 |
414 // Background properties. | 416 // Background properties. |
415 // background-color | 417 // background-color |
416 static Color InitialBackgroundColor() { return Color::kTransparent; } | 418 static Color InitialBackgroundColor() { return Color::kTransparent; } |
417 void SetBackgroundColor(const StyleColor& v) { | 419 void SetBackgroundColor(const StyleColor& v) { |
418 SET_VAR(background_data_, background_color_, v); | 420 SET_VAR(background_data_, color_, v); |
419 } | 421 } |
420 | 422 |
421 // background-image | 423 // background-image |
422 bool HasBackgroundImage() const { | 424 bool HasBackgroundImage() const { |
423 return background_data_->background_.HasImage(); | 425 return background_data_->Background().HasImage(); |
424 } | 426 } |
425 bool HasFixedBackgroundImage() const { | 427 bool HasFixedBackgroundImage() const { |
426 return background_data_->background_.HasFixedImage(); | 428 return background_data_->Background().HasFixedImage(); |
427 } | 429 } |
428 bool HasEntirelyFixedBackground() const; | 430 bool HasEntirelyFixedBackground() const; |
429 | 431 |
430 // background-clip | 432 // background-clip |
431 EFillBox BackgroundClip() const { | 433 EFillBox BackgroundClip() const { |
432 return static_cast<EFillBox>(background_data_->background_.Clip()); | 434 return static_cast<EFillBox>(background_data_->Background().Clip()); |
433 } | 435 } |
434 | 436 |
435 // Border properties. | 437 // Border properties. |
436 // -webkit-border-image | 438 // -webkit-border-image |
437 static NinePieceImage InitialNinePieceImage() { return NinePieceImage(); } | 439 static NinePieceImage InitialNinePieceImage() { return NinePieceImage(); } |
438 const NinePieceImage& BorderImage() const { | 440 const NinePieceImage& BorderImage() const { |
439 return surround_data_->border_.GetImage(); | 441 return surround_data_->border_.GetImage(); |
440 } | 442 } |
441 void SetBorderImage(const NinePieceImage& b) { | 443 void SetBorderImage(const NinePieceImage& b) { |
442 SET_VAR(surround_data_, border_.image_, b); | 444 SET_VAR(surround_data_, border_.image_, b); |
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3356 bool HasBoxDecorationBackground() const { | 3358 bool HasBoxDecorationBackground() const { |
3357 return HasBackground() || HasBorderDecoration() || HasAppearance() || | 3359 return HasBackground() || HasBorderDecoration() || HasAppearance() || |
3358 BoxShadow(); | 3360 BoxShadow(); |
3359 } | 3361 } |
3360 | 3362 |
3361 // Background utility functions. | 3363 // Background utility functions. |
3362 FillLayer& AccessBackgroundLayers() { | 3364 FillLayer& AccessBackgroundLayers() { |
3363 return background_data_.Access()->background_; | 3365 return background_data_.Access()->background_; |
3364 } | 3366 } |
3365 const FillLayer& BackgroundLayers() const { | 3367 const FillLayer& BackgroundLayers() const { |
3366 return background_data_->background_; | 3368 return background_data_->Background(); |
3367 } | 3369 } |
3368 void AdjustBackgroundLayers() { | 3370 void AdjustBackgroundLayers() { |
3369 if (BackgroundLayers().Next()) { | 3371 if (BackgroundLayers().Next()) { |
3370 AccessBackgroundLayers().CullEmptyLayers(); | 3372 AccessBackgroundLayers().CullEmptyLayers(); |
3371 AccessBackgroundLayers().FillUnsetProperties(); | 3373 AccessBackgroundLayers().FillUnsetProperties(); |
3372 } | 3374 } |
3373 } | 3375 } |
3374 bool HasBackgroundRelatedColorReferencingCurrentColor() const { | 3376 bool HasBackgroundRelatedColorReferencingCurrentColor() const { |
3375 if (BackgroundColor().IsCurrentColor() || | 3377 if (BackgroundColor().IsCurrentColor() || |
3376 VisitedLinkBackgroundColor().IsCurrentColor()) | 3378 VisitedLinkBackgroundColor().IsCurrentColor()) |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3491 } | 3493 } |
3492 StyleColor BorderRightColor() const { | 3494 StyleColor BorderRightColor() const { |
3493 return surround_data_->border_.Right().GetColor(); | 3495 return surround_data_->border_.Right().GetColor(); |
3494 } | 3496 } |
3495 StyleColor BorderTopColor() const { | 3497 StyleColor BorderTopColor() const { |
3496 return surround_data_->border_.Top().GetColor(); | 3498 return surround_data_->border_.Top().GetColor(); |
3497 } | 3499 } |
3498 StyleColor BorderBottomColor() const { | 3500 StyleColor BorderBottomColor() const { |
3499 return surround_data_->border_.Bottom().GetColor(); | 3501 return surround_data_->border_.Bottom().GetColor(); |
3500 } | 3502 } |
3501 StyleColor BackgroundColor() const { | 3503 StyleColor BackgroundColor() const { return background_data_->GetColor(); } |
3502 return background_data_->background_color_; | |
3503 } | |
3504 StyleAutoColor CaretColor() const { | 3504 StyleAutoColor CaretColor() const { |
3505 return rare_inherited_data_->CaretColor(); | 3505 return rare_inherited_data_->CaretColor(); |
3506 } | 3506 } |
3507 Color GetColor() const; | 3507 Color GetColor() const; |
3508 StyleColor ColumnRuleColor() const { | 3508 StyleColor ColumnRuleColor() const { |
3509 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); | 3509 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); |
3510 } | 3510 } |
3511 StyleColor OutlineColor() const { | 3511 StyleColor OutlineColor() const { |
3512 return rare_non_inherited_data_->outline_.GetColor(); | 3512 return rare_non_inherited_data_->outline_.GetColor(); |
3513 } | 3513 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3690 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3690 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3691 } | 3691 } |
3692 | 3692 |
3693 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3693 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3694 return PseudoBitsInternal() & kElementPseudoIdMask; | 3694 return PseudoBitsInternal() & kElementPseudoIdMask; |
3695 } | 3695 } |
3696 | 3696 |
3697 } // namespace blink | 3697 } // namespace blink |
3698 | 3698 |
3699 #endif // ComputedStyle_h | 3699 #endif // ComputedStyle_h |
OLD | NEW |