Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2916563003: Compute effective touch action in StyleAdjuster. (Closed)
Patch Set: Move ComputeEffectiveTouchAction out of AdjustComputedStyle. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow); 1511 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow);
1512 } 1512 }
1513 1513
1514 // touch-action 1514 // touch-action
1515 static TouchAction InitialTouchAction() { 1515 static TouchAction InitialTouchAction() {
1516 return TouchAction::kTouchActionAuto; 1516 return TouchAction::kTouchActionAuto;
1517 } 1517 }
1518 TouchAction GetTouchAction() const { 1518 TouchAction GetTouchAction() const {
1519 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_); 1519 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_);
1520 } 1520 }
1521 TouchAction GetEffectiveTouchAction() const {
1522 return static_cast<TouchAction>(
1523 rare_inherited_data_->effective_touch_action_);
1524 }
1521 void SetTouchAction(TouchAction t) { 1525 void SetTouchAction(TouchAction t) {
1522 SET_VAR(rare_non_inherited_data_, touch_action_, t); 1526 SET_VAR(rare_non_inherited_data_, touch_action_, t);
1523 } 1527 }
1528 void SetEffectiveTouchAction(TouchAction t) {
1529 SET_VAR(rare_inherited_data_, effective_touch_action_, t);
1530 }
1524 1531
1525 // vertical-align 1532 // vertical-align
1526 static EVerticalAlign InitialVerticalAlign() { 1533 static EVerticalAlign InitialVerticalAlign() {
1527 return EVerticalAlign::kBaseline; 1534 return EVerticalAlign::kBaseline;
1528 } 1535 }
1529 EVerticalAlign VerticalAlign() const { return VerticalAlignInternal(); } 1536 EVerticalAlign VerticalAlign() const { return VerticalAlignInternal(); }
1530 const Length& GetVerticalAlignLength() const { 1537 const Length& GetVerticalAlignLength() const {
1531 return VerticalAlignLengthInternal(); 1538 return VerticalAlignLengthInternal();
1532 } 1539 }
1533 void SetVerticalAlign(EVerticalAlign v) { SetVerticalAlignInternal(v); } 1540 void SetVerticalAlign(EVerticalAlign v) { SetVerticalAlignInternal(v); }
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
3003 // visible on only one overflow value. 3010 // visible on only one overflow value.
3004 bool IsOverflowVisible() const { 3011 bool IsOverflowVisible() const {
3005 DCHECK(OverflowX() != EOverflow::kVisible || OverflowX() == OverflowY()); 3012 DCHECK(OverflowX() != EOverflow::kVisible || OverflowX() == OverflowY());
3006 return OverflowX() == EOverflow::kVisible; 3013 return OverflowX() == EOverflow::kVisible;
3007 } 3014 }
3008 bool IsOverflowPaged() const { 3015 bool IsOverflowPaged() const {
3009 return OverflowY() == EOverflow::kWebkitPagedX || 3016 return OverflowY() == EOverflow::kWebkitPagedX ||
3010 OverflowY() == EOverflow::kWebkitPagedY; 3017 OverflowY() == EOverflow::kWebkitPagedY;
3011 } 3018 }
3012 3019
3020 bool IsDisplayTableRowOrColumnType() const {
3021 return Display() == EDisplay::kTableRow ||
3022 Display() == EDisplay::kTableRowGroup ||
3023 Display() == EDisplay::kTableColumn ||
3024 Display() == EDisplay::kTableColumnGroup;
3025 }
3026
3027 bool ScrollsOverflow() const {
3028 bool overflow_x = OverflowX() == EOverflow::kScroll ||
3029 OverflowX() == EOverflow::kAuto ||
3030 OverflowX() == EOverflow::kOverlay;
3031 bool overflow_y = OverflowY() == EOverflow::kScroll ||
3032 OverflowY() == EOverflow::kAuto ||
3033 OverflowY() == EOverflow::kWebkitPagedY ||
3034 OverflowY() == EOverflow::kOverlay;
flackr 2017/06/07 18:21:47 Can you move the code from HasAutoVerticalScrollba
sunxd 2017/06/08 19:08:12 Done.
3035 return overflow_x || overflow_y;
3036 }
3037
3013 // Visibility utility functions. 3038 // Visibility utility functions.
3014 bool VisibleToHitTesting() const { 3039 bool VisibleToHitTesting() const {
3015 return Visibility() == EVisibility::kVisible && 3040 return Visibility() == EVisibility::kVisible &&
3016 PointerEvents() != EPointerEvents::kNone; 3041 PointerEvents() != EPointerEvents::kNone;
3017 } 3042 }
3018 3043
3019 // Animation utility functions. 3044 // Animation utility functions.
3020 bool ShouldCompositeForCurrentAnimations() const { 3045 bool ShouldCompositeForCurrentAnimations() const {
3021 return HasCurrentOpacityAnimation() || HasCurrentTransformAnimation() || 3046 return HasCurrentOpacityAnimation() || HasCurrentTransformAnimation() ||
3022 HasCurrentFilterAnimation() || HasCurrentBackdropFilterAnimation(); 3047 HasCurrentFilterAnimation() || HasCurrentBackdropFilterAnimation();
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
3592 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3617 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3593 } 3618 }
3594 3619
3595 inline bool ComputedStyle::HasPseudoElementStyle() const { 3620 inline bool ComputedStyle::HasPseudoElementStyle() const {
3596 return PseudoBitsInternal() & kElementPseudoIdMask; 3621 return PseudoBitsInternal() & kElementPseudoIdMask;
3597 } 3622 }
3598 3623
3599 } // namespace blink 3624 } // namespace blink
3600 3625
3601 #endif // ComputedStyle_h 3626 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698