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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
411 rare_non_inherited_data_->backface_visibility_); | 411 rare_non_inherited_data_->backface_visibility_); |
412 } | 412 } |
413 void SetBackfaceVisibility(EBackfaceVisibility b) { | 413 void SetBackfaceVisibility(EBackfaceVisibility b) { |
414 SET_VAR(rare_non_inherited_data_, backface_visibility_, b); | 414 SET_VAR(rare_non_inherited_data_, backface_visibility_, b); |
415 } | 415 } |
416 | 416 |
417 // Background properties. | 417 // Background properties. |
418 // background-color | 418 // background-color |
419 static Color InitialBackgroundColor() { return Color::kTransparent; } | 419 static Color InitialBackgroundColor() { return Color::kTransparent; } |
420 void SetBackgroundColor(const StyleColor& v) { | 420 void SetBackgroundColor(const StyleColor& v) { |
421 SET_VAR(background_data_, background_color_, v); | 421 SetBackgroundColorInternal(v); |
422 } | 422 } |
423 | 423 |
424 // background-image | 424 // background-image |
425 bool HasBackgroundImage() const { | 425 bool HasBackgroundImage() const { return BackgroundInternal().HasImage(); } |
426 return background_data_->background_.HasImage(); | |
427 } | |
428 bool HasFixedBackgroundImage() const { | 426 bool HasFixedBackgroundImage() const { |
429 return background_data_->background_.HasFixedImage(); | 427 return BackgroundInternal().HasFixedImage(); |
430 } | 428 } |
431 bool HasEntirelyFixedBackground() const; | 429 bool HasEntirelyFixedBackground() const; |
432 | 430 |
433 // background-clip | 431 // background-clip |
434 EFillBox BackgroundClip() const { | 432 EFillBox BackgroundClip() const { |
435 return static_cast<EFillBox>(background_data_->background_.Clip()); | 433 return static_cast<EFillBox>(BackgroundInternal().Clip()); |
436 } | 434 } |
437 | 435 |
438 // Border properties. | 436 // Border properties. |
439 // -webkit-border-image | 437 // -webkit-border-image |
440 static NinePieceImage InitialNinePieceImage() { return NinePieceImage(); } | 438 static NinePieceImage InitialNinePieceImage() { return NinePieceImage(); } |
441 const NinePieceImage& BorderImage() const { | 439 const NinePieceImage& BorderImage() const { |
442 return surround_data_->border_.GetImage(); | 440 return surround_data_->border_.GetImage(); |
443 } | 441 } |
444 void SetBorderImage(const NinePieceImage& b) { | 442 void SetBorderImage(const NinePieceImage& b) { |
445 SET_VAR(surround_data_, border_.image_, b); | 443 SET_VAR(surround_data_, border_.image_, b); |
(...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3386 | 3384 |
3387 // "Box decoration background" includes all box decorations and backgrounds | 3385 // "Box decoration background" includes all box decorations and backgrounds |
3388 // that are painted as the background of the object. It includes borders, | 3386 // that are painted as the background of the object. It includes borders, |
3389 // box-shadows, background-color and background-image, etc. | 3387 // box-shadows, background-color and background-image, etc. |
3390 bool HasBoxDecorationBackground() const { | 3388 bool HasBoxDecorationBackground() const { |
3391 return HasBackground() || HasBorderDecoration() || HasAppearance() || | 3389 return HasBackground() || HasBorderDecoration() || HasAppearance() || |
3392 BoxShadow(); | 3390 BoxShadow(); |
3393 } | 3391 } |
3394 | 3392 |
3395 // Background utility functions. | 3393 // Background utility functions. |
3396 FillLayer& AccessBackgroundLayers() { | 3394 FillLayer& AccessBackgroundLayers() { return MutableBackgroundInternal(); } |
shend
2017/05/16 07:50:06
yay these actually have uses :P
nainar
2017/05/16 07:51:28
lol. :P we are way too excited if this makes us ha
| |
3397 return background_data_.Access()->background_; | 3395 const FillLayer& BackgroundLayers() const { return BackgroundInternal(); } |
3398 } | |
3399 const FillLayer& BackgroundLayers() const { | |
3400 return background_data_->background_; | |
3401 } | |
3402 void AdjustBackgroundLayers() { | 3396 void AdjustBackgroundLayers() { |
3403 if (BackgroundLayers().Next()) { | 3397 if (BackgroundLayers().Next()) { |
3404 AccessBackgroundLayers().CullEmptyLayers(); | 3398 AccessBackgroundLayers().CullEmptyLayers(); |
3405 AccessBackgroundLayers().FillUnsetProperties(); | 3399 AccessBackgroundLayers().FillUnsetProperties(); |
3406 } | 3400 } |
3407 } | 3401 } |
3408 bool HasBackgroundRelatedColorReferencingCurrentColor() const { | 3402 bool HasBackgroundRelatedColorReferencingCurrentColor() const { |
3409 if (BackgroundColor().IsCurrentColor() || | 3403 if (BackgroundColor().IsCurrentColor() || |
3410 VisitedLinkBackgroundColor().IsCurrentColor()) | 3404 VisitedLinkBackgroundColor().IsCurrentColor()) |
3411 return true; | 3405 return true; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3547 return BorderTopColorIsCurrentColor() | 3541 return BorderTopColorIsCurrentColor() |
3548 ? StyleColor::CurrentColor() | 3542 ? StyleColor::CurrentColor() |
3549 : StyleColor(BorderTopColorInternal()); | 3543 : StyleColor(BorderTopColorInternal()); |
3550 } | 3544 } |
3551 StyleColor BorderBottomColor() const { | 3545 StyleColor BorderBottomColor() const { |
3552 return BorderBottomColorIsCurrentColor() | 3546 return BorderBottomColorIsCurrentColor() |
3553 ? StyleColor::CurrentColor() | 3547 ? StyleColor::CurrentColor() |
3554 : StyleColor(BorderBottomColorInternal()); | 3548 : StyleColor(BorderBottomColorInternal()); |
3555 } | 3549 } |
3556 | 3550 |
3557 StyleColor BackgroundColor() const { | 3551 StyleColor BackgroundColor() const { return BackgroundColorInternal(); } |
3558 return background_data_->background_color_; | |
3559 } | |
3560 StyleAutoColor CaretColor() const { | 3552 StyleAutoColor CaretColor() const { |
3561 if (rare_inherited_data_->caret_color_is_current_color_) | 3553 if (rare_inherited_data_->caret_color_is_current_color_) |
3562 return StyleAutoColor::CurrentColor(); | 3554 return StyleAutoColor::CurrentColor(); |
3563 if (rare_inherited_data_->caret_color_is_auto_) | 3555 if (rare_inherited_data_->caret_color_is_auto_) |
3564 return StyleAutoColor::AutoColor(); | 3556 return StyleAutoColor::AutoColor(); |
3565 return StyleAutoColor(rare_inherited_data_->caret_color_); | 3557 return StyleAutoColor(rare_inherited_data_->caret_color_); |
3566 } | 3558 } |
3567 Color GetColor() const; | 3559 Color GetColor() const; |
3568 StyleColor ColumnRuleColor() const { | 3560 StyleColor ColumnRuleColor() const { |
3569 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); | 3561 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3771 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3763 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3772 } | 3764 } |
3773 | 3765 |
3774 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3766 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3775 return PseudoBitsInternal() & kElementPseudoIdMask; | 3767 return PseudoBitsInternal() & kElementPseudoIdMask; |
3776 } | 3768 } |
3777 | 3769 |
3778 } // namespace blink | 3770 } // namespace blink |
3779 | 3771 |
3780 #endif // ComputedStyle_h | 3772 #endif // ComputedStyle_h |
OLD | NEW |