| 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 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3260 FloatRoundedRect getRoundedInnerBorderFor( | 3260 FloatRoundedRect getRoundedInnerBorderFor( |
| 3261 const LayoutRect& borderRect, | 3261 const LayoutRect& borderRect, |
| 3262 bool includeLogicalLeftEdge = true, | 3262 bool includeLogicalLeftEdge = true, |
| 3263 bool includeLogicalRightEdge = true) const; | 3263 bool includeLogicalRightEdge = true) const; |
| 3264 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, | 3264 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, |
| 3265 const LayoutRectOutsets& insets, | 3265 const LayoutRectOutsets& insets, |
| 3266 bool includeLogicalLeftEdge, | 3266 bool includeLogicalLeftEdge, |
| 3267 bool includeLogicalRightEdge) const; | 3267 bool includeLogicalRightEdge) const; |
| 3268 | 3268 |
| 3269 // Float utility functions. | 3269 // Float utility functions. |
| 3270 bool isFloating() const { return floating() != EFloat::None; } | 3270 bool isFloating() const { return floating() != EFloat::kNone; } |
| 3271 | 3271 |
| 3272 // Mix-blend-mode utility functions. | 3272 // Mix-blend-mode utility functions. |
| 3273 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } | 3273 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } |
| 3274 | 3274 |
| 3275 // Motion utility functions. | 3275 // Motion utility functions. |
| 3276 bool hasOffset() const { | 3276 bool hasOffset() const { |
| 3277 return (offsetPosition().x() != Length(Auto)) || offsetPath(); | 3277 return (offsetPosition().x() != Length(Auto)) || offsetPath(); |
| 3278 } | 3278 } |
| 3279 | 3279 |
| 3280 // Direction utility functions. | 3280 // Direction utility functions. |
| 3281 bool isLeftToRightDirection() const { | 3281 bool isLeftToRightDirection() const { |
| 3282 return direction() == TextDirection::Ltr; | 3282 return direction() == TextDirection::kLtr; |
| 3283 } | 3283 } |
| 3284 | 3284 |
| 3285 // Perspective utility functions. | 3285 // Perspective utility functions. |
| 3286 bool hasPerspective() const { | 3286 bool hasPerspective() const { |
| 3287 return m_rareNonInheritedData->m_perspective > 0; | 3287 return m_rareNonInheritedData->m_perspective > 0; |
| 3288 } | 3288 } |
| 3289 | 3289 |
| 3290 // Page size utility functions. | 3290 // Page size utility functions. |
| 3291 void resetPageSizeType() { | 3291 void resetPageSizeType() { |
| 3292 SET_VAR(m_rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); | 3292 SET_VAR(m_rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3416 bool isOverflowVisible() const { | 3416 bool isOverflowVisible() const { |
| 3417 DCHECK(overflowX() != EOverflow::Visible || overflowX() == overflowY()); | 3417 DCHECK(overflowX() != EOverflow::Visible || overflowX() == overflowY()); |
| 3418 return overflowX() == EOverflow::Visible; | 3418 return overflowX() == EOverflow::Visible; |
| 3419 } | 3419 } |
| 3420 bool isOverflowPaged() const { | 3420 bool isOverflowPaged() const { |
| 3421 return overflowY() == EOverflow::PagedX || overflowY() == EOverflow::PagedY; | 3421 return overflowY() == EOverflow::PagedX || overflowY() == EOverflow::PagedY; |
| 3422 } | 3422 } |
| 3423 | 3423 |
| 3424 // Visibility utility functions. | 3424 // Visibility utility functions. |
| 3425 bool visibleToHitTesting() const { | 3425 bool visibleToHitTesting() const { |
| 3426 return visibility() == EVisibility::Visible && | 3426 return visibility() == EVisibility::kVisible && |
| 3427 pointerEvents() != EPointerEvents::None; | 3427 pointerEvents() != EPointerEvents::kNone; |
| 3428 } | 3428 } |
| 3429 | 3429 |
| 3430 // Animation utility functions. | 3430 // Animation utility functions. |
| 3431 bool shouldCompositeForCurrentAnimations() const { | 3431 bool shouldCompositeForCurrentAnimations() const { |
| 3432 return hasCurrentOpacityAnimation() || hasCurrentTransformAnimation() || | 3432 return hasCurrentOpacityAnimation() || hasCurrentTransformAnimation() || |
| 3433 hasCurrentFilterAnimation() || hasCurrentBackdropFilterAnimation(); | 3433 hasCurrentFilterAnimation() || hasCurrentBackdropFilterAnimation(); |
| 3434 } | 3434 } |
| 3435 bool isRunningAnimationOnCompositor() const { | 3435 bool isRunningAnimationOnCompositor() const { |
| 3436 return isRunningOpacityAnimationOnCompositor() || | 3436 return isRunningOpacityAnimationOnCompositor() || |
| 3437 isRunningTransformAnimationOnCompositor() || | 3437 isRunningTransformAnimationOnCompositor() || |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3561 bool canContainAbsolutePositionObjects() const { | 3561 bool canContainAbsolutePositionObjects() const { |
| 3562 return position() != StaticPosition; | 3562 return position() != StaticPosition; |
| 3563 } | 3563 } |
| 3564 bool canContainFixedPositionObjects() const { | 3564 bool canContainFixedPositionObjects() const { |
| 3565 return hasTransformRelatedProperty() || containsPaint(); | 3565 return hasTransformRelatedProperty() || containsPaint(); |
| 3566 } | 3566 } |
| 3567 | 3567 |
| 3568 // Whitespace utility functions. | 3568 // Whitespace utility functions. |
| 3569 static bool autoWrap(EWhiteSpace ws) { | 3569 static bool autoWrap(EWhiteSpace ws) { |
| 3570 // Nowrap and pre don't automatically wrap. | 3570 // Nowrap and pre don't automatically wrap. |
| 3571 return ws != EWhiteSpace::Nowrap && ws != EWhiteSpace::Pre; | 3571 return ws != EWhiteSpace::kNowrap && ws != EWhiteSpace::kPre; |
| 3572 } | 3572 } |
| 3573 | 3573 |
| 3574 bool autoWrap() const { return autoWrap(whiteSpace()); } | 3574 bool autoWrap() const { return autoWrap(whiteSpace()); } |
| 3575 | 3575 |
| 3576 static bool preserveNewline(EWhiteSpace ws) { | 3576 static bool preserveNewline(EWhiteSpace ws) { |
| 3577 // Normal and nowrap do not preserve newlines. | 3577 // Normal and nowrap do not preserve newlines. |
| 3578 return ws != EWhiteSpace::Normal && ws != EWhiteSpace::Nowrap; | 3578 return ws != EWhiteSpace::kNormal && ws != EWhiteSpace::kNowrap; |
| 3579 } | 3579 } |
| 3580 | 3580 |
| 3581 bool preserveNewline() const { return preserveNewline(whiteSpace()); } | 3581 bool preserveNewline() const { return preserveNewline(whiteSpace()); } |
| 3582 | 3582 |
| 3583 static bool collapseWhiteSpace(EWhiteSpace ws) { | 3583 static bool collapseWhiteSpace(EWhiteSpace ws) { |
| 3584 // Pre and prewrap do not collapse whitespace. | 3584 // Pre and prewrap do not collapse whitespace. |
| 3585 return ws != EWhiteSpace::Pre && ws != EWhiteSpace::PreWrap; | 3585 return ws != EWhiteSpace::kPre && ws != EWhiteSpace::kPreWrap; |
| 3586 } | 3586 } |
| 3587 | 3587 |
| 3588 bool collapseWhiteSpace() const { return collapseWhiteSpace(whiteSpace()); } | 3588 bool collapseWhiteSpace() const { return collapseWhiteSpace(whiteSpace()); } |
| 3589 | 3589 |
| 3590 bool isCollapsibleWhiteSpace(UChar c) const { | 3590 bool isCollapsibleWhiteSpace(UChar c) const { |
| 3591 switch (c) { | 3591 switch (c) { |
| 3592 case ' ': | 3592 case ' ': |
| 3593 case '\t': | 3593 case '\t': |
| 3594 return collapseWhiteSpace(); | 3594 return collapseWhiteSpace(); |
| 3595 case '\n': | 3595 case '\n': |
| 3596 return !preserveNewline(); | 3596 return !preserveNewline(); |
| 3597 } | 3597 } |
| 3598 return false; | 3598 return false; |
| 3599 } | 3599 } |
| 3600 bool breakOnlyAfterWhiteSpace() const { | 3600 bool breakOnlyAfterWhiteSpace() const { |
| 3601 return whiteSpace() == EWhiteSpace::PreWrap || | 3601 return whiteSpace() == EWhiteSpace::kPreWrap || |
| 3602 getLineBreak() == LineBreakAfterWhiteSpace; | 3602 getLineBreak() == LineBreakAfterWhiteSpace; |
| 3603 } | 3603 } |
| 3604 | 3604 |
| 3605 bool breakWords() const { | 3605 bool breakWords() const { |
| 3606 return (wordBreak() == BreakWordBreak || | 3606 return (wordBreak() == BreakWordBreak || |
| 3607 overflowWrap() == BreakOverflowWrap) && | 3607 overflowWrap() == BreakOverflowWrap) && |
| 3608 whiteSpace() != EWhiteSpace::Pre && | 3608 whiteSpace() != EWhiteSpace::kPre && |
| 3609 whiteSpace() != EWhiteSpace::Nowrap; | 3609 whiteSpace() != EWhiteSpace::kNowrap; |
| 3610 } | 3610 } |
| 3611 | 3611 |
| 3612 // Text direction utility functions. | 3612 // Text direction utility functions. |
| 3613 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { | 3613 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { |
| 3614 return !isLeftToRightDirection() && isHorizontalWritingMode(); | 3614 return !isLeftToRightDirection() && isHorizontalWritingMode(); |
| 3615 } | 3615 } |
| 3616 bool hasInlinePaginationAxis() const { | 3616 bool hasInlinePaginationAxis() const { |
| 3617 // If the pagination axis is parallel with the writing mode inline axis, | 3617 // If the pagination axis is parallel with the writing mode inline axis, |
| 3618 // columns may be laid out along the inline axis, just like for regular | 3618 // columns may be laid out along the inline axis, just like for regular |
| 3619 // multicol. Otherwise, we need to lay out along the block axis. | 3619 // multicol. Otherwise, we need to lay out along the block axis. |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3953 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); | 3953 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - 1); |
| 3954 } | 3954 } |
| 3955 | 3955 |
| 3956 inline bool ComputedStyle::hasPseudoElementStyle() const { | 3956 inline bool ComputedStyle::hasPseudoElementStyle() const { |
| 3957 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 3957 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
| 3958 } | 3958 } |
| 3959 | 3959 |
| 3960 } // namespace blink | 3960 } // namespace blink |
| 3961 | 3961 |
| 3962 #endif // ComputedStyle_h | 3962 #endif // ComputedStyle_h |
| OLD | NEW |