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

Side by Side Diff: Source/core/layout/LayoutObject.h

Issue 1212893005: Add position: sticky as supported position value when CSSStickyPosition is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 && !isLayoutFullScreen() 502 && !isLayoutFullScreen()
503 && !isLayoutFullScreenPlaceholder(); 503 && !isLayoutFullScreenPlaceholder();
504 } 504 }
505 bool isElementContinuation() const { return node() && node()->layoutObject() != this; } 505 bool isElementContinuation() const { return node() && node()->layoutObject() != this; }
506 bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); } 506 bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
507 virtual LayoutBoxModelObject* virtualContinuation() const { return nullptr; } 507 virtual LayoutBoxModelObject* virtualContinuation() const { return nullptr; }
508 508
509 bool isFloating() const { return m_bitfields.floating(); } 509 bool isFloating() const { return m_bitfields.floating(); }
510 510
511 bool isOutOfFlowPositioned() const { return m_bitfields.isOutOfFlowPositione d(); } // absolute or fixed positioning 511 bool isOutOfFlowPositioned() const { return m_bitfields.isOutOfFlowPositione d(); } // absolute or fixed positioning
512 bool isInFlowPositioned() const { return m_bitfields.isInFlowPositioned(); } // relative or sticky positioning
512 bool isRelPositioned() const { return m_bitfields.isRelPositioned(); } // re lative positioning 513 bool isRelPositioned() const { return m_bitfields.isRelPositioned(); } // re lative positioning
514 bool isStickyPositioned() const { return m_bitfields.isStickyPositioned(); } // sticky positioning
513 bool isPositioned() const { return m_bitfields.isPositioned(); } 515 bool isPositioned() const { return m_bitfields.isPositioned(); }
514 516
515 bool isText() const { return m_bitfields.isText(); } 517 bool isText() const { return m_bitfields.isText(); }
516 bool isBox() const { return m_bitfields.isBox(); } 518 bool isBox() const { return m_bitfields.isBox(); }
517 bool isInline() const { return m_bitfields.isInline(); } // inline object 519 bool isInline() const { return m_bitfields.isInline(); } // inline object
518 bool isDragging() const { return m_bitfields.isDragging(); } 520 bool isDragging() const { return m_bitfields.isDragging(); }
519 bool isReplaced() const { return m_bitfields.isReplaced(); } // a "replaced" element (see CSS) 521 bool isReplaced() const { return m_bitfields.isReplaced(); } // a "replaced" element (see CSS)
520 bool isHorizontalWritingMode() const { return m_bitfields.horizontalWritingM ode(); } 522 bool isHorizontalWritingMode() const { return m_bitfields.horizontalWritingM ode(); }
521 bool hasFlippedBlocksWritingMode() const 523 bool hasFlippedBlocksWritingMode() const
522 { 524 {
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 unsigned m_##name : 1;\ 1273 unsigned m_##name : 1;\
1272 public:\ 1274 public:\
1273 bool name() const { return m_##name; }\ 1275 bool name() const { return m_##name; }\
1274 void set##Name(bool name) { m_##name = name; }\ 1276 void set##Name(bool name) { m_##name = name; }\
1275 1277
1276 class LayoutObjectBitfields { 1278 class LayoutObjectBitfields {
1277 enum PositionedState { 1279 enum PositionedState {
1278 IsStaticallyPositioned = 0, 1280 IsStaticallyPositioned = 0,
1279 IsRelativelyPositioned = 1, 1281 IsRelativelyPositioned = 1,
1280 IsOutOfFlowPositioned = 2, 1282 IsOutOfFlowPositioned = 2,
1283 IsStickyPositioned = 3,
1281 }; 1284 };
1282 1285
1283 public: 1286 public:
1284 LayoutObjectBitfields(Node* node) 1287 LayoutObjectBitfields(Node* node)
1285 : m_selfNeedsLayout(false) 1288 : m_selfNeedsLayout(false)
1286 , m_shouldInvalidateOverflowForPaint(false) 1289 , m_shouldInvalidateOverflowForPaint(false)
1287 // FIXME: We should remove mayNeedPaintInvalidation once we are able to 1290 // FIXME: We should remove mayNeedPaintInvalidation once we are able to
1288 // use the other layout flags to detect the same cases. crbug.com/37 0118 1291 // use the other layout flags to detect the same cases. crbug.com/37 0118
1289 , m_mayNeedPaintInvalidation(false) 1292 , m_mayNeedPaintInvalidation(false)
1290 , m_shouldInvalidateSelection(false) 1293 , m_shouldInvalidateSelection(false)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1383
1381 private: 1384 private:
1382 unsigned m_positionedState : 2; // PositionedState 1385 unsigned m_positionedState : 2; // PositionedState
1383 unsigned m_selectionState : 3; // SelectionState 1386 unsigned m_selectionState : 3; // SelectionState
1384 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS tate 1387 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS tate
1385 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason 1388 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason
1386 1389
1387 public: 1390 public:
1388 bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOf FlowPositioned; } 1391 bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOf FlowPositioned; }
1389 bool isRelPositioned() const { return m_positionedState == IsRelativelyP ositioned; } 1392 bool isRelPositioned() const { return m_positionedState == IsRelativelyP ositioned; }
1393 bool isStickyPositioned() const { return m_positionedState == IsStickyPo sitioned; }
1394 bool isInFlowPositioned() const { return m_positionedState == IsRelative lyPositioned || m_positionedState == IsStickyPositioned; }
1390 bool isPositioned() const { return m_positionedState != IsStaticallyPosi tioned; } 1395 bool isPositioned() const { return m_positionedState != IsStaticallyPosi tioned; }
1391 1396
1392 void setPositionedState(int positionState) 1397 void setPositionedState(int positionState)
1393 { 1398 {
1394 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP ositioned, saving one bit. 1399 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP ositioned, saving one bit.
1395 m_positionedState = static_cast<PositionedState>(positionState & 0x3 ); 1400 m_positionedState = static_cast<PositionedState>(positionState & 0x3 );
1396 } 1401 }
1397 void clearPositionedState() { m_positionedState = StaticPosition; } 1402 void clearPositionedState() { m_positionedState = StaticPosition; }
1398 1403
1399 ALWAYS_INLINE SelectionState selectionState() const { return static_cast <SelectionState>(m_selectionState); } 1404 ALWAYS_INLINE SelectionState selectionState() const { return static_cast <SelectionState>(m_selectionState); }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 void showTree(const blink::LayoutObject*); 1663 void showTree(const blink::LayoutObject*);
1659 void showLineTree(const blink::LayoutObject*); 1664 void showLineTree(const blink::LayoutObject*);
1660 void showLayoutTree(const blink::LayoutObject* object1); 1665 void showLayoutTree(const blink::LayoutObject* object1);
1661 // We don't make object2 an optional parameter so that showLayoutTree 1666 // We don't make object2 an optional parameter so that showLayoutTree
1662 // can be called from gdb easily. 1667 // can be called from gdb easily.
1663 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1668 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1664 1669
1665 #endif 1670 #endif
1666 1671
1667 #endif // LayoutObject_h 1672 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698