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

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

Issue 2716583005: Do not promote position sticky or fixed elements unless they move with scroll. (Closed)
Patch Set: Create a stacking context for sticky. Created 3 years, 9 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 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after
3141 // Position utility functions. 3141 // Position utility functions.
3142 bool hasOutOfFlowPosition() const { 3142 bool hasOutOfFlowPosition() const {
3143 return position() == EPosition::kAbsolute || 3143 return position() == EPosition::kAbsolute ||
3144 position() == EPosition::kFixed; 3144 position() == EPosition::kFixed;
3145 } 3145 }
3146 bool hasInFlowPosition() const { 3146 bool hasInFlowPosition() const {
3147 return position() == EPosition::kRelative || 3147 return position() == EPosition::kRelative ||
3148 position() == EPosition::kSticky; 3148 position() == EPosition::kSticky;
3149 } 3149 }
3150 bool hasViewportConstrainedPosition() const { 3150 bool hasViewportConstrainedPosition() const {
3151 return position() == EPosition::kFixed || position() == EPosition::kSticky; 3151 return position() == EPosition::kFixed;
3152 }
3153 bool hasStickyConstrainedPosition() const {
3154 return position() == EPosition::kSticky &&
3155 (!top().isAuto() || !left().isAuto() || !right().isAuto() ||
3156 !bottom().isAuto());
3152 } 3157 }
3153 3158
3154 // Clip utility functions. 3159 // Clip utility functions.
3155 const Length& clipLeft() const { return m_visual->clip.left(); } 3160 const Length& clipLeft() const { return m_visual->clip.left(); }
3156 const Length& clipRight() const { return m_visual->clip.right(); } 3161 const Length& clipRight() const { return m_visual->clip.right(); }
3157 const Length& clipTop() const { return m_visual->clip.top(); } 3162 const Length& clipTop() const { return m_visual->clip.top(); }
3158 const Length& clipBottom() const { return m_visual->clip.bottom(); } 3163 const Length& clipBottom() const { return m_visual->clip.bottom(); }
3159 3164
3160 // Offset utility functions. 3165 // Offset utility functions.
3161 // Accessors for positioned object edges that take into account writing mode. 3166 // Accessors for positioned object edges that take into account writing mode.
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
3804 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId); 3809 m_nonInheritedData.m_pseudoBits |= 1 << (pseudo - FirstPublicPseudoId);
3805 } 3810 }
3806 3811
3807 inline bool ComputedStyle::hasPseudoElementStyle() const { 3812 inline bool ComputedStyle::hasPseudoElementStyle() const {
3808 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; 3813 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask;
3809 } 3814 }
3810 3815
3811 } // namespace blink 3816 } // namespace blink
3812 3817
3813 #endif // ComputedStyle_h 3818 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698