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

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

Issue 2916563003: Compute effective touch action in StyleAdjuster. (Closed)
Patch Set: Unifying ScrollsOverflow 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 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow); 1498 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow);
1499 } 1499 }
1500 1500
1501 // touch-action 1501 // touch-action
1502 static TouchAction InitialTouchAction() { 1502 static TouchAction InitialTouchAction() {
1503 return TouchAction::kTouchActionAuto; 1503 return TouchAction::kTouchActionAuto;
1504 } 1504 }
1505 TouchAction GetTouchAction() const { 1505 TouchAction GetTouchAction() const {
1506 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_); 1506 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_);
1507 } 1507 }
1508 TouchAction GetEffectiveTouchAction() const {
1509 return static_cast<TouchAction>(
1510 rare_inherited_data_->effective_touch_action_);
1511 }
1508 void SetTouchAction(TouchAction t) { 1512 void SetTouchAction(TouchAction t) {
1509 SET_VAR(rare_non_inherited_data_, touch_action_, t); 1513 SET_VAR(rare_non_inherited_data_, touch_action_, t);
1510 } 1514 }
1515 void SetEffectiveTouchAction(TouchAction t) {
1516 SET_VAR(rare_inherited_data_, effective_touch_action_, t);
1517 }
1511 1518
1512 // vertical-align 1519 // vertical-align
1513 static EVerticalAlign InitialVerticalAlign() { 1520 static EVerticalAlign InitialVerticalAlign() {
1514 return EVerticalAlign::kBaseline; 1521 return EVerticalAlign::kBaseline;
1515 } 1522 }
1516 EVerticalAlign VerticalAlign() const { return VerticalAlignInternal(); } 1523 EVerticalAlign VerticalAlign() const { return VerticalAlignInternal(); }
1517 const Length& GetVerticalAlignLength() const { 1524 const Length& GetVerticalAlignLength() const {
1518 return VerticalAlignLengthInternal(); 1525 return VerticalAlignLengthInternal();
1519 } 1526 }
1520 void SetVerticalAlign(EVerticalAlign v) { SetVerticalAlignInternal(v); } 1527 void SetVerticalAlign(EVerticalAlign v) { SetVerticalAlignInternal(v); }
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2979 // visible on only one overflow value. 2986 // visible on only one overflow value.
2980 bool IsOverflowVisible() const { 2987 bool IsOverflowVisible() const {
2981 DCHECK(OverflowX() != EOverflow::kVisible || OverflowX() == OverflowY()); 2988 DCHECK(OverflowX() != EOverflow::kVisible || OverflowX() == OverflowY());
2982 return OverflowX() == EOverflow::kVisible; 2989 return OverflowX() == EOverflow::kVisible;
2983 } 2990 }
2984 bool IsOverflowPaged() const { 2991 bool IsOverflowPaged() const {
2985 return OverflowY() == EOverflow::kWebkitPagedX || 2992 return OverflowY() == EOverflow::kWebkitPagedX ||
2986 OverflowY() == EOverflow::kWebkitPagedY; 2993 OverflowY() == EOverflow::kWebkitPagedY;
2987 } 2994 }
2988 2995
2996 bool IsDisplayTableRowOrColumnType() const {
2997 return Display() == EDisplay::kTableRow ||
2998 Display() == EDisplay::kTableRowGroup ||
2999 Display() == EDisplay::kTableColumn ||
3000 Display() == EDisplay::kTableColumnGroup;
3001 }
3002
3003 bool HasAutoHorizontalScrollbar() const {
flackr 2017/06/08 19:35:21 nit: We should avoid saying scrollbar, since it ju
sunxd 2017/06/09 21:00:35 Done.
3004 return OverflowX() == EOverflow::kAuto ||
3005 OverflowX() == EOverflow::kOverlay;
3006 }
3007
3008 bool HasAutoVerticalScrollbar() const {
3009 return OverflowY() == EOverflow::kAuto ||
3010 OverflowY() == EOverflow::kWebkitPagedY ||
3011 OverflowY() == EOverflow::kOverlay;
3012 }
3013
3014 bool ScrollsOverflowX() const {
3015 return OverflowX() == EOverflow::kScroll || HasAutoHorizontalScrollbar();
3016 }
3017
3018 bool ScrollsOverflowY() const {
3019 return OverflowY() == EOverflow::kScroll || HasAutoVerticalScrollbar();
3020 }
3021
3022 bool ScrollsOverflow() const {
3023 return ScrollsOverflowX() || ScrollsOverflowY();
3024 }
3025
2989 // Visibility utility functions. 3026 // Visibility utility functions.
2990 bool VisibleToHitTesting() const { 3027 bool VisibleToHitTesting() const {
2991 return Visibility() == EVisibility::kVisible && 3028 return Visibility() == EVisibility::kVisible &&
2992 PointerEvents() != EPointerEvents::kNone; 3029 PointerEvents() != EPointerEvents::kNone;
2993 } 3030 }
2994 3031
2995 // Animation utility functions. 3032 // Animation utility functions.
2996 bool ShouldCompositeForCurrentAnimations() const { 3033 bool ShouldCompositeForCurrentAnimations() const {
2997 return HasCurrentOpacityAnimation() || HasCurrentTransformAnimation() || 3034 return HasCurrentOpacityAnimation() || HasCurrentTransformAnimation() ||
2998 HasCurrentFilterAnimation() || HasCurrentBackdropFilterAnimation(); 3035 HasCurrentFilterAnimation() || HasCurrentBackdropFilterAnimation();
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3609 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3573 } 3610 }
3574 3611
3575 inline bool ComputedStyle::HasPseudoElementStyle() const { 3612 inline bool ComputedStyle::HasPseudoElementStyle() const {
3576 return PseudoBitsInternal() & kElementPseudoIdMask; 3613 return PseudoBitsInternal() & kElementPseudoIdMask;
3577 } 3614 }
3578 3615
3579 } // namespace blink 3616 } // namespace blink
3580 3617
3581 #endif // ComputedStyle_h 3618 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698