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

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: Rebase. Created 4 years, 8 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 #ifndef NDEBUG 239 #ifndef NDEBUG
240 static WTF::RefCountedLeakCounter& layoutObjectCounter() 240 static WTF::RefCountedLeakCounter& layoutObjectCounter()
241 { 241 {
242 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, ( "LayoutObject")); 242 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, ( "LayoutObject"));
243 return staticLayoutObjectCounter; 243 return staticLayoutObjectCounter;
244 } 244 }
245 #endif 245 #endif
246 246
247 LayoutObject::LayoutObject(Node* node) 247 LayoutObject::LayoutObject(Node* node)
248 : ImageResourceClient() 248 : m_style(nullptr)
249 , m_style(nullptr)
250 , m_node(node) 249 , m_node(node)
251 , m_parent(nullptr) 250 , m_parent(nullptr)
252 , m_previous(nullptr) 251 , m_previous(nullptr)
253 , m_next(nullptr) 252 , m_next(nullptr)
254 #if ENABLE(ASSERT) 253 #if ENABLE(ASSERT)
255 , m_hasAXObject(false) 254 , m_hasAXObject(false)
256 , m_setNeedsLayoutForbidden(false) 255 , m_setNeedsLayoutForbidden(false)
257 #endif 256 #endif
258 , m_bitfields(node) 257 , m_bitfields(node)
259 { 258 {
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after
3201 LayoutBox* box = toLayoutBox(this); 3200 LayoutBox* box = toLayoutBox(this);
3202 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); 3201 FloatRect localBounds(FloatPoint(), FloatSize(box->size()));
3203 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); 3202 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox();
3204 3203
3205 AnnotatedRegionValue region; 3204 AnnotatedRegionValue region;
3206 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; 3205 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
3207 region.bounds = LayoutRect(absBounds); 3206 region.bounds = LayoutRect(absBounds);
3208 regions.append(region); 3207 regions.append(region);
3209 } 3208 }
3210 3209
3211 bool LayoutObject::willRenderImage(ImageResource*) 3210 bool LayoutObject::willRenderImage()
3212 { 3211 {
3213 // Without visibility we won't render (and therefore don't care about animat ion). 3212 // Without visibility we won't render (and therefore don't care about animat ion).
3214 if (style()->visibility() != VISIBLE) 3213 if (style()->visibility() != VISIBLE)
3215 return false; 3214 return false;
3216 3215
3217 // We will not render a new image when Active DOM is suspended 3216 // We will not render a new image when Active DOM is suspended
3218 if (document().activeDOMObjectsAreSuspended()) 3217 if (document().activeDOMObjectsAreSuspended())
3219 return false; 3218 return false;
3220 3219
3221 // If we're not in a window (i.e., we're dormant from being in a background tab) 3220 // If we're not in a window (i.e., we're dormant from being in a background tab)
3222 // then we don't want to render either. 3221 // then we don't want to render either.
3223 return document().view()->isVisible(); 3222 return document().view()->isVisible();
3224 } 3223 }
3225 3224
3226 bool LayoutObject::getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy& policy) 3225 bool LayoutObject::getImageAnimationPolicy(ImageAnimationPolicy& policy)
3227 { 3226 {
3228 if (!document().settings()) 3227 if (!document().settings())
3229 return false; 3228 return false;
3230 policy = document().settings()->imageAnimationPolicy(); 3229 policy = document().settings()->imageAnimationPolicy();
3231 return true; 3230 return true;
3232 } 3231 }
3233 3232
3234 int LayoutObject::caretMinOffset() const 3233 int LayoutObject::caretMinOffset() const
3235 { 3234 {
3236 return 0; 3235 return 0;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
3727 const blink::LayoutObject* root = object1; 3726 const blink::LayoutObject* root = object1;
3728 while (root->parent()) 3727 while (root->parent())
3729 root = root->parent(); 3728 root = root->parent();
3730 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3729 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3731 } else { 3730 } else {
3732 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3731 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3733 } 3732 }
3734 } 3733 }
3735 3734
3736 #endif 3735 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698