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

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

Issue 2916563003: Compute effective touch action in StyleAdjuster. (Closed)
Patch Set: resolve comments 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 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow); 1455 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow);
1456 } 1456 }
1457 1457
1458 // touch-action 1458 // touch-action
1459 static TouchAction InitialTouchAction() { 1459 static TouchAction InitialTouchAction() {
1460 return TouchAction::kTouchActionAuto; 1460 return TouchAction::kTouchActionAuto;
1461 } 1461 }
1462 TouchAction GetTouchAction() const { 1462 TouchAction GetTouchAction() const {
1463 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_); 1463 return static_cast<TouchAction>(rare_non_inherited_data_->touch_action_);
1464 } 1464 }
1465 TouchAction GetEffectiveTouchAction() const {
1466 return static_cast<TouchAction>(
1467 rare_inherited_data_->effective_touch_action_);
1468 }
1465 void SetTouchAction(TouchAction t) { 1469 void SetTouchAction(TouchAction t) {
1466 SET_VAR(rare_non_inherited_data_, touch_action_, t); 1470 SET_VAR(rare_non_inherited_data_, touch_action_, t);
1467 } 1471 }
1472 void SetEffectiveTouchAction(TouchAction t) {
1473 SET_VAR(rare_inherited_data_, effective_touch_action_, t);
1474 }
1468 1475
1469 // vertical-align 1476 // vertical-align
1470 static EVerticalAlign InitialVerticalAlign() { 1477 static EVerticalAlign InitialVerticalAlign() {
1471 return EVerticalAlign::kBaseline; 1478 return EVerticalAlign::kBaseline;
1472 } 1479 }
1473 EVerticalAlign VerticalAlign() const { return VerticalAlignInternal(); } 1480 EVerticalAlign VerticalAlign() const { return VerticalAlignInternal(); }
1474 const Length& GetVerticalAlignLength() const { 1481 const Length& GetVerticalAlignLength() const {
1475 return VerticalAlignLengthInternal(); 1482 return VerticalAlignLengthInternal();
1476 } 1483 }
1477 void SetVerticalAlign(EVerticalAlign v) { SetVerticalAlignInternal(v); } 1484 void SetVerticalAlign(EVerticalAlign v) { SetVerticalAlignInternal(v); }
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 // visible on only one overflow value. 2950 // visible on only one overflow value.
2944 bool IsOverflowVisible() const { 2951 bool IsOverflowVisible() const {
2945 DCHECK(OverflowX() != EOverflow::kVisible || OverflowX() == OverflowY()); 2952 DCHECK(OverflowX() != EOverflow::kVisible || OverflowX() == OverflowY());
2946 return OverflowX() == EOverflow::kVisible; 2953 return OverflowX() == EOverflow::kVisible;
2947 } 2954 }
2948 bool IsOverflowPaged() const { 2955 bool IsOverflowPaged() const {
2949 return OverflowY() == EOverflow::kWebkitPagedX || 2956 return OverflowY() == EOverflow::kWebkitPagedX ||
2950 OverflowY() == EOverflow::kWebkitPagedY; 2957 OverflowY() == EOverflow::kWebkitPagedY;
2951 } 2958 }
2952 2959
2960 bool IsDisplayTableRowOrColumnType() const {
2961 return Display() == EDisplay::kTableRow ||
2962 Display() == EDisplay::kTableRowGroup ||
2963 Display() == EDisplay::kTableColumn ||
2964 Display() == EDisplay::kTableColumnGroup;
2965 }
2966
2967 bool HasAutoHorizontalScroll() const {
2968 return OverflowX() == EOverflow::kAuto ||
2969 OverflowX() == EOverflow::kOverlay;
2970 }
2971
2972 bool HasAutoVerticalScroll() const {
2973 return OverflowY() == EOverflow::kAuto ||
2974 OverflowY() == EOverflow::kWebkitPagedY ||
2975 OverflowY() == EOverflow::kOverlay;
2976 }
2977
2978 bool ScrollsOverflowX() const {
2979 return OverflowX() == EOverflow::kScroll || HasAutoHorizontalScroll();
2980 }
2981
2982 bool ScrollsOverflowY() const {
2983 return OverflowY() == EOverflow::kScroll || HasAutoVerticalScroll();
2984 }
2985
2986 bool ScrollsOverflow() const {
2987 return ScrollsOverflowX() || ScrollsOverflowY();
2988 }
2989
2953 // Visibility utility functions. 2990 // Visibility utility functions.
2954 bool VisibleToHitTesting() const { 2991 bool VisibleToHitTesting() const {
2955 return Visibility() == EVisibility::kVisible && 2992 return Visibility() == EVisibility::kVisible &&
2956 PointerEvents() != EPointerEvents::kNone; 2993 PointerEvents() != EPointerEvents::kNone;
2957 } 2994 }
2958 2995
2959 // Animation utility functions. 2996 // Animation utility functions.
2960 bool ShouldCompositeForCurrentAnimations() const { 2997 bool ShouldCompositeForCurrentAnimations() const {
2961 return HasCurrentOpacityAnimation() || HasCurrentTransformAnimation() || 2998 return HasCurrentOpacityAnimation() || HasCurrentTransformAnimation() ||
2962 HasCurrentFilterAnimation() || HasCurrentBackdropFilterAnimation(); 2999 HasCurrentFilterAnimation() || HasCurrentBackdropFilterAnimation();
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
3564 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); 3601 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId)));
3565 } 3602 }
3566 3603
3567 inline bool ComputedStyle::HasPseudoElementStyle() const { 3604 inline bool ComputedStyle::HasPseudoElementStyle() const {
3568 return PseudoBitsInternal() & kElementPseudoIdMask; 3605 return PseudoBitsInternal() & kElementPseudoIdMask;
3569 } 3606 }
3570 3607
3571 } // namespace blink 3608 } // namespace blink
3572 3609
3573 #endif // ComputedStyle_h 3610 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698