OLD | NEW |
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 #ifndef NDEBUG | 237 #ifndef NDEBUG |
238 static WTF::RefCountedLeakCounter& layoutObjectCounter() | 238 static WTF::RefCountedLeakCounter& layoutObjectCounter() |
239 { | 239 { |
240 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, (
"LayoutObject")); | 240 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, (
"LayoutObject")); |
241 return staticLayoutObjectCounter; | 241 return staticLayoutObjectCounter; |
242 } | 242 } |
243 #endif | 243 #endif |
244 | 244 |
245 LayoutObject::LayoutObject(Node* node) | 245 LayoutObject::LayoutObject(Node* node) |
246 : ImageResourceClient() | 246 : m_style(nullptr) |
247 , m_style(nullptr) | |
248 , m_node(node) | 247 , m_node(node) |
249 , m_parent(nullptr) | 248 , m_parent(nullptr) |
250 , m_previous(nullptr) | 249 , m_previous(nullptr) |
251 , m_next(nullptr) | 250 , m_next(nullptr) |
252 #if ENABLE(ASSERT) | 251 #if ENABLE(ASSERT) |
253 , m_hasAXObject(false) | 252 , m_hasAXObject(false) |
254 , m_setNeedsLayoutForbidden(false) | 253 , m_setNeedsLayoutForbidden(false) |
255 #endif | 254 #endif |
256 , m_bitfields(node) | 255 , m_bitfields(node) |
257 { | 256 { |
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3078 LayoutBox* box = toLayoutBox(this); | 3077 LayoutBox* box = toLayoutBox(this); |
3079 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); | 3078 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); |
3080 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); | 3079 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); |
3081 | 3080 |
3082 AnnotatedRegionValue region; | 3081 AnnotatedRegionValue region; |
3083 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; | 3082 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; |
3084 region.bounds = LayoutRect(absBounds); | 3083 region.bounds = LayoutRect(absBounds); |
3085 regions.append(region); | 3084 regions.append(region); |
3086 } | 3085 } |
3087 | 3086 |
3088 bool LayoutObject::willRenderImage(ImageResource*) | 3087 bool LayoutObject::willRenderImage() |
3089 { | 3088 { |
3090 // Without visibility we won't render (and therefore don't care about animat
ion). | 3089 // Without visibility we won't render (and therefore don't care about animat
ion). |
3091 if (style()->visibility() != VISIBLE) | 3090 if (style()->visibility() != VISIBLE) |
3092 return false; | 3091 return false; |
3093 | 3092 |
3094 // We will not render a new image when Active DOM is suspended | 3093 // We will not render a new image when Active DOM is suspended |
3095 if (document().activeDOMObjectsAreSuspended()) | 3094 if (document().activeDOMObjectsAreSuspended()) |
3096 return false; | 3095 return false; |
3097 | 3096 |
3098 // If we're not in a window (i.e., we're dormant from being in a background
tab) | 3097 // If we're not in a window (i.e., we're dormant from being in a background
tab) |
3099 // then we don't want to render either. | 3098 // then we don't want to render either. |
3100 return document().view()->isVisible(); | 3099 return document().view()->isVisible(); |
3101 } | 3100 } |
3102 | 3101 |
3103 bool LayoutObject::getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&
policy) | 3102 bool LayoutObject::getImageAnimationPolicy(ImageAnimationPolicy& policy) |
3104 { | 3103 { |
3105 if (!document().settings()) | 3104 if (!document().settings()) |
3106 return false; | 3105 return false; |
3107 policy = document().settings()->imageAnimationPolicy(); | 3106 policy = document().settings()->imageAnimationPolicy(); |
3108 return true; | 3107 return true; |
3109 } | 3108 } |
3110 | 3109 |
3111 int LayoutObject::caretMinOffset() const | 3110 int LayoutObject::caretMinOffset() const |
3112 { | 3111 { |
3113 return 0; | 3112 return 0; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3616 const blink::LayoutObject* root = object1; | 3615 const blink::LayoutObject* root = object1; |
3617 while (root->parent()) | 3616 while (root->parent()) |
3618 root = root->parent(); | 3617 root = root->parent(); |
3619 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3618 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3620 } else { | 3619 } else { |
3621 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3620 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3622 } | 3621 } |
3623 } | 3622 } |
3624 | 3623 |
3625 #endif | 3624 #endif |
OLD | NEW |