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

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

Issue 2280153002: Refactoring out the code in LayoutTreeAsText::writeLayoutObject. (Closed)
Patch Set: Initial commit Created 4 years, 3 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. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "core/page/AutoscrollController.h" 70 #include "core/page/AutoscrollController.h"
71 #include "core/page/Page.h" 71 #include "core/page/Page.h"
72 #include "core/paint/ObjectPaintInvalidator.h" 72 #include "core/paint/ObjectPaintInvalidator.h"
73 #include "core/paint/ObjectPaintProperties.h" 73 #include "core/paint/ObjectPaintProperties.h"
74 #include "core/paint/PaintLayer.h" 74 #include "core/paint/PaintLayer.h"
75 #include "core/style/ContentData.h" 75 #include "core/style/ContentData.h"
76 #include "core/style/CursorData.h" 76 #include "core/style/CursorData.h"
77 #include "platform/RuntimeEnabledFeatures.h" 77 #include "platform/RuntimeEnabledFeatures.h"
78 #include "platform/TracedValue.h" 78 #include "platform/TracedValue.h"
79 #include "platform/geometry/TransformState.h" 79 #include "platform/geometry/TransformState.h"
80 #include "platform/scroll/ScrollableArea.h"
80 #include "wtf/allocator/Partitions.h" 81 #include "wtf/allocator/Partitions.h"
81 #include "wtf/text/StringBuilder.h" 82 #include "wtf/text/StringBuilder.h"
82 #include "wtf/text/WTFString.h" 83 #include "wtf/text/WTFString.h"
83 #include <algorithm> 84 #include <algorithm>
84 #include <memory> 85 #include <memory>
85 #ifndef NDEBUG 86 #ifndef NDEBUG
86 #include <stdio.h> 87 #include <stdio.h>
87 #endif 88 #endif
88 89
89 namespace blink { 90 namespace blink {
(...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after
3193 ObjectPaintProperties& LayoutObject::ensureObjectPaintProperties() 3194 ObjectPaintProperties& LayoutObject::ensureObjectPaintProperties()
3194 { 3195 {
3195 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 3196 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
3196 auto addResult = objectPaintPropertiesMap().add(this, nullptr); 3197 auto addResult = objectPaintPropertiesMap().add(this, nullptr);
3197 if (addResult.isNewEntry) 3198 if (addResult.isNewEntry)
3198 addResult.storedValue->value = ObjectPaintProperties::create(); 3199 addResult.storedValue->value = ObjectPaintProperties::create();
3199 3200
3200 return *addResult.storedValue->value; 3201 return *addResult.storedValue->value;
3201 } 3202 }
3202 3203
3204 void LayoutObject::setLayoutRectDimForLayoutView(LayoutRect& rect) const
3205 {
3206 if (isLayoutView()) {
benjhayden 2016/08/29 20:45:27 Should this be moved to a virtual method so that L
lunalu1 2016/08/30 20:35:30 Could you please clarify on this? So to create a v
3207 rect.setWidth(LayoutUnit(toLayoutView(this)->viewWidth(IncludeScrollbars )));
3208 rect.setHeight(LayoutUnit(toLayoutView(this)->viewHeight(IncludeScrollba rs)));
3209 }
3210 }
3211
3203 } // namespace blink 3212 } // namespace blink
3204 3213
3205 #ifndef NDEBUG 3214 #ifndef NDEBUG
3206 3215
3207 void showTree(const blink::LayoutObject* object) 3216 void showTree(const blink::LayoutObject* object)
3208 { 3217 {
3209 if (object) 3218 if (object)
3210 object->showTreeForThis(); 3219 object->showTreeForThis();
3211 else 3220 else
3212 WTFLogAlways("%s", "Cannot showTree. Root is (nil)"); 3221 WTFLogAlways("%s", "Cannot showTree. Root is (nil)");
(...skipping 18 matching lines...) Expand all
3231 const blink::LayoutObject* root = object1; 3240 const blink::LayoutObject* root = object1;
3232 while (root->parent()) 3241 while (root->parent())
3233 root = root->parent(); 3242 root = root->parent();
3234 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3243 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3235 } else { 3244 } else {
3236 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3245 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3237 } 3246 }
3238 } 3247 }
3239 3248
3240 #endif 3249 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698