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

Side by Side Diff: sky/engine/core/rendering/RenderObject.h

Issue 686633002: First pass at removing position:fixed. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // FIXME(sky): remove this. 516 // FIXME(sky): remove this.
517 Node* generatingNode() const { return node(); } 517 Node* generatingNode() const { return node(); }
518 518
519 Document& document() const { return m_node->document(); } 519 Document& document() const { return m_node->document(); }
520 LocalFrame* frame() const { return document().frame(); } 520 LocalFrame* frame() const { return document().frame(); }
521 521
522 // Returns the object containing this one. Can be different from parent for positioned elements. 522 // Returns the object containing this one. Can be different from parent for positioned elements.
523 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n ot null, on return *paintInvalidationContainerSkipped 523 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n ot null, on return *paintInvalidationContainerSkipped
524 // is true if the renderer returned is an ancestor of paintInvalidationConta iner. 524 // is true if the renderer returned is an ancestor of paintInvalidationConta iner.
525 RenderObject* container(const RenderLayerModelObject* paintInvalidationConta iner = 0, bool* paintInvalidationContainerSkipped = 0) const; 525 RenderObject* container(const RenderLayerModelObject* paintInvalidationConta iner = 0, bool* paintInvalidationContainerSkipped = 0) const;
526 RenderBlock* containerForFixedPosition(const RenderLayerModelObject* paintIn validationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const;
527 526
528 virtual RenderObject* hoverAncestor() const { return parent(); } 527 virtual RenderObject* hoverAncestor() const { return parent(); }
529 528
530 Element* offsetParent() const; 529 Element* offsetParent() const;
531 530
532 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0); 531 void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObjec t* newRoot = 0, SubtreeLayoutScope* = 0);
533 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0); 532 void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, SubtreeLayou tScope* = 0);
534 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContaining BlockChain, SubtreeLayoutScope* = 0); 533 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContaining BlockChain, SubtreeLayoutScope* = 0);
535 void clearNeedsLayout(); 534 void clearNeedsLayout();
536 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0); 535 void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, Subtree LayoutScope* = 0);
537 void setNeedsPositionedMovementLayout(); 536 void setNeedsPositionedMovementLayout();
538 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in); 537 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainingBlockCha in);
539 void clearPreferredLogicalWidthsDirty(); 538 void clearPreferredLogicalWidthsDirty();
540 void invalidateContainerPreferredLogicalWidths(); 539 void invalidateContainerPreferredLogicalWidths();
541 540
542 void setNeedsLayoutAndPrefWidthsRecalc() 541 void setNeedsLayoutAndPrefWidthsRecalc()
543 { 542 {
544 setNeedsLayout(); 543 setNeedsLayout();
545 setPreferredLogicalWidthsDirty(); 544 setPreferredLogicalWidthsDirty();
546 } 545 }
547 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation() 546 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation()
548 { 547 {
549 setNeedsLayoutAndFullPaintInvalidation(); 548 setNeedsLayoutAndFullPaintInvalidation();
550 setPreferredLogicalWidthsDirty(); 549 setPreferredLogicalWidthsDirty();
551 } 550 }
552 551
553 void setPositionState(EPosition position) 552 void setPositionState(EPosition position)
554 { 553 {
555 ASSERT((position != AbsolutePosition && position != FixedPosition) || is Box()); 554 ASSERT(position != AbsolutePosition || isBox());
556 m_bitfields.setPositionedState(position); 555 m_bitfields.setPositionedState(position);
557 } 556 }
558 void clearPositionedState() { m_bitfields.clearPositionedState(); } 557 void clearPositionedState() { m_bitfields.clearPositionedState(); }
559 558
560 void setFloating(bool isFloating) { m_bitfields.setFloating(isFloating); } 559 void setFloating(bool isFloating) { m_bitfields.setFloating(isFloating); }
561 void setInline(bool isInline) { m_bitfields.setIsInline(isInline); } 560 void setInline(bool isInline) { m_bitfields.setIsInline(isInline); }
562 561
563 void setHasBoxDecorationBackground(bool); 562 void setHasBoxDecorationBackground(bool);
564 void invalidateBackgroundObscurationStatus(); 563 void invalidateBackgroundObscurationStatus();
565 virtual bool computeBackgroundIsKnownToBeObscured() { return false; } 564 virtual bool computeBackgroundIsKnownToBeObscured() { return false; }
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 unsigned m_selectionState : 3; // SelectionState 1133 unsigned m_selectionState : 3; // SelectionState
1135 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS tate 1134 unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundS tate
1136 1135
1137 public: 1136 public:
1138 bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOf FlowPositioned; } 1137 bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOf FlowPositioned; }
1139 bool isRelPositioned() const { return m_positionedState == IsRelativelyP ositioned; } 1138 bool isRelPositioned() const { return m_positionedState == IsRelativelyP ositioned; }
1140 bool isPositioned() const { return m_positionedState != IsStaticallyPosi tioned; } 1139 bool isPositioned() const { return m_positionedState != IsStaticallyPosi tioned; }
1141 1140
1142 void setPositionedState(int positionState) 1141 void setPositionedState(int positionState)
1143 { 1142 {
1143 // FIXME(sky): Simplify now that we don't have FixedPosition.
1144 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP ositioned, saving one bit. 1144 // This mask maps FixedPosition and AbsolutePosition to IsOutOfFlowP ositioned, saving one bit.
1145 m_positionedState = static_cast<PositionedState>(positionState & 0x3 ); 1145 m_positionedState = static_cast<PositionedState>(positionState & 0x3 );
1146 } 1146 }
1147 void clearPositionedState() { m_positionedState = StaticPosition; } 1147 void clearPositionedState() { m_positionedState = StaticPosition; }
1148 1148
1149 ALWAYS_INLINE SelectionState selectionState() const { return static_cast <SelectionState>(m_selectionState); } 1149 ALWAYS_INLINE SelectionState selectionState() const { return static_cast <SelectionState>(m_selectionState); }
1150 ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_ selectionState = selectionState; } 1150 ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_ selectionState = selectionState; }
1151 1151
1152 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState( ) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr oundState); } 1152 ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState( ) const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgr oundState); }
1153 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou ndState s) { m_boxDecorationBackgroundState = s; } 1153 ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgrou ndState s) { m_boxDecorationBackgroundState = s; }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 void showTree(const blink::RenderObject*); 1344 void showTree(const blink::RenderObject*);
1345 void showLineTree(const blink::RenderObject*); 1345 void showLineTree(const blink::RenderObject*);
1346 void showRenderTree(const blink::RenderObject* object1); 1346 void showRenderTree(const blink::RenderObject* object1);
1347 // We don't make object2 an optional parameter so that showRenderTree 1347 // We don't make object2 an optional parameter so that showRenderTree
1348 // can be called from gdb easily. 1348 // can be called from gdb easily.
1349 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); 1349 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2);
1350 1350
1351 #endif 1351 #endif
1352 1352
1353 #endif // RenderObject_h 1353 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayerModelObject.cpp ('k') | sky/engine/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698