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

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

Issue 1261653002: Move SelectionState out of LayoutObject and into Line Layout API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2 legit 5ever Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/api/SelectionState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 #include "core/editing/TextAffinity.h" 35 #include "core/editing/TextAffinity.h"
36 #include "core/fetch/ImageResourceClient.h" 36 #include "core/fetch/ImageResourceClient.h"
37 #include "core/html/HTMLElement.h" 37 #include "core/html/HTMLElement.h"
38 #include "core/inspector/InspectorTraceEvents.h" 38 #include "core/inspector/InspectorTraceEvents.h"
39 #include "core/layout/HitTestRequest.h" 39 #include "core/layout/HitTestRequest.h"
40 #include "core/layout/LayoutObjectChildList.h" 40 #include "core/layout/LayoutObjectChildList.h"
41 #include "core/layout/PaintInvalidationState.h" 41 #include "core/layout/PaintInvalidationState.h"
42 #include "core/layout/ScrollAlignment.h" 42 #include "core/layout/ScrollAlignment.h"
43 #include "core/layout/SubtreeLayoutScope.h" 43 #include "core/layout/SubtreeLayoutScope.h"
44 #include "core/layout/api/HitTestAction.h" 44 #include "core/layout/api/HitTestAction.h"
45 #include "core/layout/api/SelectionState.h"
45 #include "core/layout/compositing/CompositingState.h" 46 #include "core/layout/compositing/CompositingState.h"
46 #include "core/layout/compositing/CompositingTriggers.h" 47 #include "core/layout/compositing/CompositingTriggers.h"
47 #include "core/style/ComputedStyle.h" 48 #include "core/style/ComputedStyle.h"
48 #include "core/style/StyleInheritedData.h" 49 #include "core/style/StyleInheritedData.h"
49 #include "platform/geometry/FloatQuad.h" 50 #include "platform/geometry/FloatQuad.h"
50 #include "platform/geometry/LayoutRect.h" 51 #include "platform/geometry/LayoutRect.h"
51 #include "platform/graphics/CompositingReasons.h" 52 #include "platform/graphics/CompositingReasons.h"
52 #include "platform/graphics/PaintInvalidationReason.h" 53 #include "platform/graphics/PaintInvalidationReason.h"
53 #include "platform/graphics/paint/DisplayItemClient.h" 54 #include "platform/graphics/paint/DisplayItemClient.h"
54 #include "platform/transforms/TransformationMatrix.h" 55 #include "platform/transforms/TransformationMatrix.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 885
885 virtual unsigned length() const { return 1; } 886 virtual unsigned length() const { return 1; }
886 887
887 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut OfFlowPositioned()); } 888 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut OfFlowPositioned()); }
888 889
889 bool isTransparent() const { return style()->hasOpacity(); } 890 bool isTransparent() const { return style()->hasOpacity(); }
890 float opacity() const { return style()->opacity(); } 891 float opacity() const { return style()->opacity(); }
891 892
892 bool hasReflection() const { return m_bitfields.hasReflection(); } 893 bool hasReflection() const { return m_bitfields.hasReflection(); }
893 894
894 enum SelectionState {
895 SelectionNone, // The object is not selected.
896 SelectionStart, // The object either contains the start of a selection r un or is the start of a run
897 SelectionInside, // The object is fully encompassed by a selection run
898 SelectionEnd, // The object either contains the end of a selection run o r is the end of a run
899 SelectionBoth // The object contains an entire run or is the sole select ed object in that run
900 };
901
902 // The current selection state for an object. For blocks, the state refers to the state of the leaf 895 // The current selection state for an object. For blocks, the state refers to the state of the leaf
903 // descendants (as described above in the SelectionState enum declaration). 896 // descendants (as described above in the SelectionState enum declaration).
904 SelectionState selectionState() const { return m_bitfields.selectionState(); } 897 SelectionState selectionState() const { return m_bitfields.selectionState(); }
905 virtual void setSelectionState(SelectionState state) { m_bitfields.setSelect ionState(state); } 898 virtual void setSelectionState(SelectionState state) { m_bitfields.setSelect ionState(state); }
906 inline void setSelectionStateIfNeeded(SelectionState); 899 inline void setSelectionStateIfNeeded(SelectionState);
907 bool canUpdateSelectionOnRootLineBoxes() const; 900 bool canUpdateSelectionOnRootLineBoxes() const;
908 901
909 // A single rectangle that encompasses all of the selected objects within th is object. Used to determine the tightest 902 // A single rectangle that encompasses all of the selected objects within th is object. Used to determine the tightest
910 // possible bounding box for the selection. The rect returned is in the coor dinate space of the paint invalidation container's backing. 903 // possible bounding box for the selection. The rect returned is in the coor dinate space of the paint invalidation container's backing.
911 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObj ect* /*paintInvalidationContainer*/) const { return LayoutRect(); } 904 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObj ect* /*paintInvalidationContainer*/) const { return LayoutRect(); }
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 void showTree(const blink::LayoutObject*); 1654 void showTree(const blink::LayoutObject*);
1662 void showLineTree(const blink::LayoutObject*); 1655 void showLineTree(const blink::LayoutObject*);
1663 void showLayoutTree(const blink::LayoutObject* object1); 1656 void showLayoutTree(const blink::LayoutObject* object1);
1664 // We don't make object2 an optional parameter so that showLayoutTree 1657 // We don't make object2 an optional parameter so that showLayoutTree
1665 // can be called from gdb easily. 1658 // can be called from gdb easily.
1666 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 1659 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
1667 1660
1668 #endif 1661 #endif
1669 1662
1670 #endif // LayoutObject_h 1663 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/api/SelectionState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698