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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2683233005: Set caret width based on device scale factor (Closed)
Patch Set: Sync with ToT again Created 3 years, 10 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 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) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 10 matching lines...) Expand all
21 * 21 *
22 * You should have received a copy of the GNU Library General Public License 22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB. If not, write to 23 * along with this library; see the file COPYING.LIB. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA. 25 * Boston, MA 02110-1301, USA.
26 * 26 *
27 */ 27 */
28 28
29 #include "core/layout/LayoutObject.h" 29 #include "core/layout/LayoutObject.h"
30 30
31 #include <algorithm>
32 #include <memory>
33
31 #include "core/animation/ElementAnimations.h" 34 #include "core/animation/ElementAnimations.h"
32 #include "core/css/resolver/StyleResolver.h" 35 #include "core/css/resolver/StyleResolver.h"
33 #include "core/dom/AXObjectCache.h" 36 #include "core/dom/AXObjectCache.h"
34 #include "core/dom/ElementTraversal.h" 37 #include "core/dom/ElementTraversal.h"
35 #include "core/dom/StyleChangeReason.h" 38 #include "core/dom/StyleChangeReason.h"
36 #include "core/dom/StyleEngine.h" 39 #include "core/dom/StyleEngine.h"
37 #include "core/dom/shadow/ShadowRoot.h" 40 #include "core/dom/shadow/ShadowRoot.h"
38 #include "core/editing/EditingUtilities.h" 41 #include "core/editing/EditingUtilities.h"
39 #include "core/editing/FrameSelection.h" 42 #include "core/editing/FrameSelection.h"
40 #include "core/editing/TextAffinity.h" 43 #include "core/editing/TextAffinity.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #include "core/style/ContentData.h" 81 #include "core/style/ContentData.h"
79 #include "core/style/CursorData.h" 82 #include "core/style/CursorData.h"
80 #include "platform/InstanceCounters.h" 83 #include "platform/InstanceCounters.h"
81 #include "platform/RuntimeEnabledFeatures.h" 84 #include "platform/RuntimeEnabledFeatures.h"
82 #include "platform/geometry/TransformState.h" 85 #include "platform/geometry/TransformState.h"
83 #include "platform/graphics/GraphicsLayer.h" 86 #include "platform/graphics/GraphicsLayer.h"
84 #include "platform/instrumentation/tracing/TracedValue.h" 87 #include "platform/instrumentation/tracing/TracedValue.h"
85 #include "wtf/allocator/Partitions.h" 88 #include "wtf/allocator/Partitions.h"
86 #include "wtf/text/StringBuilder.h" 89 #include "wtf/text/StringBuilder.h"
87 #include "wtf/text/WTFString.h" 90 #include "wtf/text/WTFString.h"
88 #include <algorithm>
89 #include <memory>
90 #ifndef NDEBUG 91 #ifndef NDEBUG
91 #include <stdio.h> 92 #include <stdio.h>
92 #endif 93 #endif
93 94
94 namespace blink { 95 namespace blink {
95 96
96 namespace { 97 namespace {
97 98
98 static bool gModifyLayoutTreeStructureAnyState = false; 99 static bool gModifyLayoutTreeStructureAnyState = false;
99 100
100 } // namespace 101 } // namespace
101 102
102 const LayoutUnit& caretWidth() {
103 static LayoutUnit gCaretWidth(1);
104 return gCaretWidth;
105 }
106
107 #if DCHECK_IS_ON() 103 #if DCHECK_IS_ON()
108 104
109 LayoutObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope( 105 LayoutObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(
110 LayoutObject& layoutObject) 106 LayoutObject& layoutObject)
111 : m_layoutObject(layoutObject), 107 : m_layoutObject(layoutObject),
112 m_preexistingForbidden(m_layoutObject.isSetNeedsLayoutForbidden()) { 108 m_preexistingForbidden(m_layoutObject.isSetNeedsLayoutForbidden()) {
113 m_layoutObject.setNeedsLayoutIsForbidden(true); 109 m_layoutObject.setNeedsLayoutIsForbidden(true);
114 } 110 }
115 111
116 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() { 112 LayoutObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() {
(...skipping 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3497 const blink::LayoutObject* root = object1; 3493 const blink::LayoutObject* root = object1;
3498 while (root->parent()) 3494 while (root->parent())
3499 root = root->parent(); 3495 root = root->parent();
3500 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3496 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3501 } else { 3497 } else {
3502 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3498 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3503 } 3499 }
3504 } 3500 }
3505 3501
3506 #endif 3502 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698