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

Side by Side Diff: Source/WebCore/rendering/RenderObject.h

Issue 9695005: Merge 110323 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 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 * (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 Apple Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 SelectionStart, // The object either contains the start of a selection r un or is the start of a run 757 SelectionStart, // The object either contains the start of a selection r un or is the start of a run
758 SelectionInside, // The object is fully encompassed by a selection run 758 SelectionInside, // The object is fully encompassed by a selection run
759 SelectionEnd, // The object either contains the end of a selection run o r is the end of a run 759 SelectionEnd, // The object either contains the end of a selection run o r is the end of a run
760 SelectionBoth // The object contains an entire run or is the sole select ed object in that run 760 SelectionBoth // The object contains an entire run or is the sole select ed object in that run
761 }; 761 };
762 762
763 // The current selection state for an object. For blocks, the state refers to the state of the leaf 763 // The current selection state for an object. For blocks, the state refers to the state of the leaf
764 // descendants (as described above in the SelectionState enum declaration). 764 // descendants (as described above in the SelectionState enum declaration).
765 SelectionState selectionState() const { return m_bitfields.selectionState(); } 765 SelectionState selectionState() const { return m_bitfields.selectionState(); }
766 virtual void setSelectionState(SelectionState state) { m_bitfields.setSelect ionState(state); } 766 virtual void setSelectionState(SelectionState state) { m_bitfields.setSelect ionState(state); }
767 inline void setSelectionStateIfNeeded(SelectionState);
768 bool canUpdateSelectionOnRootLineBoxes();
767 769
768 // A single rectangle that encompasses all of the selected objects within th is object. Used to determine the tightest 770 // A single rectangle that encompasses all of the selected objects within th is object. Used to determine the tightest
769 // possible bounding box for the selection. 771 // possible bounding box for the selection.
770 LayoutRect selectionRect(bool clipToVisibleContent = true) { return selectio nRectForRepaint(0, clipToVisibleContent); } 772 LayoutRect selectionRect(bool clipToVisibleContent = true) { return selectio nRectForRepaint(0, clipToVisibleContent); }
771 virtual LayoutRect selectionRectForRepaint(RenderBoxModelObject* /*repaintCo ntainer*/, bool /*clipToVisibleContent*/ = true) { return LayoutRect(); } 773 virtual LayoutRect selectionRectForRepaint(RenderBoxModelObject* /*repaintCo ntainer*/, bool /*clipToVisibleContent*/ = true) { return LayoutRect(); }
772 774
773 virtual bool canBeSelectionLeaf() const { return false; } 775 virtual bool canBeSelectionLeaf() const { return false; }
774 bool hasSelectedChildren() const { return selectionState() != SelectionNone; } 776 bool hasSelectedChildren() const { return selectionState() != SelectionNone; }
775 777
776 // Obtains the selection colors that should be used when painting a selectio n. 778 // Obtains the selection colors that should be used when painting a selectio n.
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 inline bool RenderObject::preservesNewline() const 1100 inline bool RenderObject::preservesNewline() const
1099 { 1101 {
1100 #if ENABLE(SVG) 1102 #if ENABLE(SVG)
1101 if (isSVGInlineText()) 1103 if (isSVGInlineText())
1102 return false; 1104 return false;
1103 #endif 1105 #endif
1104 1106
1105 return style()->preserveNewline(); 1107 return style()->preserveNewline();
1106 } 1108 }
1107 1109
1110 inline void RenderObject::setSelectionStateIfNeeded(SelectionState state)
1111 {
1112 if (selectionState() == state)
1113 return;
1114
1115 setSelectionState(state);
1116 }
1117
1108 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi ng) 1118 inline void makeMatrixRenderable(TransformationMatrix& matrix, bool has3DRenderi ng)
1109 { 1119 {
1110 #if !ENABLE(3D_RENDERING) 1120 #if !ENABLE(3D_RENDERING)
1111 UNUSED_PARAM(has3DRendering); 1121 UNUSED_PARAM(has3DRendering);
1112 matrix.makeAffine(); 1122 matrix.makeAffine();
1113 #else 1123 #else
1114 if (!has3DRendering) 1124 if (!has3DRendering)
1115 matrix.makeAffine(); 1125 matrix.makeAffine();
1116 #endif 1126 #endif
1117 } 1127 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 // Outside the WebCore namespace for ease of invocation from gdb. 1163 // Outside the WebCore namespace for ease of invocation from gdb.
1154 void showTree(const WebCore::RenderObject*); 1164 void showTree(const WebCore::RenderObject*);
1155 void showLineTree(const WebCore::RenderObject*); 1165 void showLineTree(const WebCore::RenderObject*);
1156 void showRenderTree(const WebCore::RenderObject* object1); 1166 void showRenderTree(const WebCore::RenderObject* object1);
1157 // We don't make object2 an optional parameter so that showRenderTree 1167 // We don't make object2 an optional parameter so that showRenderTree
1158 // can be called from gdb easily. 1168 // can be called from gdb easily.
1159 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1169 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1160 #endif 1170 #endif
1161 1171
1162 #endif // RenderObject_h 1172 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderListMarker.cpp ('k') | Source/WebCore/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698