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

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

Issue 1706083002: Split ImageResourceClient into ResourceClient and ImageResourceObserver [1/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect comments and Rebase Created 4 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) 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 #ifndef NDEBUG 238 #ifndef NDEBUG
239 static WTF::RefCountedLeakCounter& layoutObjectCounter() 239 static WTF::RefCountedLeakCounter& layoutObjectCounter()
240 { 240 {
241 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, ( "LayoutObject")); 241 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, ( "LayoutObject"));
242 return staticLayoutObjectCounter; 242 return staticLayoutObjectCounter;
243 } 243 }
244 #endif 244 #endif
245 245
246 LayoutObject::LayoutObject(Node* node) 246 LayoutObject::LayoutObject(Node* node)
247 : ImageResourceClient() 247 : m_style(nullptr)
248 , m_style(nullptr)
249 , m_node(node) 248 , m_node(node)
250 , m_parent(nullptr) 249 , m_parent(nullptr)
251 , m_previous(nullptr) 250 , m_previous(nullptr)
252 , m_next(nullptr) 251 , m_next(nullptr)
253 #if ENABLE(ASSERT) 252 #if ENABLE(ASSERT)
254 , m_hasAXObject(false) 253 , m_hasAXObject(false)
255 , m_setNeedsLayoutForbidden(false) 254 , m_setNeedsLayoutForbidden(false)
256 #endif 255 #endif
257 , m_bitfields(node) 256 , m_bitfields(node)
258 { 257 {
(...skipping 2931 matching lines...) Expand 10 before | Expand all | Expand 10 after
3190 LayoutBox* box = toLayoutBox(this); 3189 LayoutBox* box = toLayoutBox(this);
3191 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); 3190 FloatRect localBounds(FloatPoint(), FloatSize(box->size()));
3192 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); 3191 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox();
3193 3192
3194 AnnotatedRegionValue region; 3193 AnnotatedRegionValue region;
3195 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; 3194 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
3196 region.bounds = LayoutRect(absBounds); 3195 region.bounds = LayoutRect(absBounds);
3197 regions.append(region); 3196 regions.append(region);
3198 } 3197 }
3199 3198
3200 bool LayoutObject::willRenderImage(ImageResource*) 3199 bool LayoutObject::willRenderImage()
3201 { 3200 {
3202 // Without visibility we won't render (and therefore don't care about animat ion). 3201 // Without visibility we won't render (and therefore don't care about animat ion).
3203 if (style()->visibility() != VISIBLE) 3202 if (style()->visibility() != VISIBLE)
3204 return false; 3203 return false;
3205 3204
3206 // We will not render a new image when Active DOM is suspended 3205 // We will not render a new image when Active DOM is suspended
3207 if (document().activeDOMObjectsAreSuspended()) 3206 if (document().activeDOMObjectsAreSuspended())
3208 return false; 3207 return false;
3209 3208
3210 // If we're not in a window (i.e., we're dormant from being in a background tab) 3209 // If we're not in a window (i.e., we're dormant from being in a background tab)
3211 // then we don't want to render either. 3210 // then we don't want to render either.
3212 return document().view()->isVisible(); 3211 return document().view()->isVisible();
3213 } 3212 }
3214 3213
3215 bool LayoutObject::getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy& policy) 3214 bool LayoutObject::getImageAnimationPolicy(ImageAnimationPolicy& policy)
3216 { 3215 {
3217 if (!document().settings()) 3216 if (!document().settings())
3218 return false; 3217 return false;
3219 policy = document().settings()->imageAnimationPolicy(); 3218 policy = document().settings()->imageAnimationPolicy();
3220 return true; 3219 return true;
3221 } 3220 }
3222 3221
3223 int LayoutObject::caretMinOffset() const 3222 int LayoutObject::caretMinOffset() const
3224 { 3223 {
3225 return 0; 3224 return 0;
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3728 const blink::LayoutObject* root = object1; 3727 const blink::LayoutObject* root = object1;
3729 while (root->parent()) 3728 while (root->parent())
3730 root = root->parent(); 3729 root = root->parent();
3731 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3730 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3732 } else { 3731 } else {
3733 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3732 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3734 } 3733 }
3735 } 3734 }
3736 3735
3737 #endif 3736 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698