| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 #ifndef NDEBUG | 236 #ifndef NDEBUG |
| 237 static WTF::RefCountedLeakCounter& layoutObjectCounter() | 237 static WTF::RefCountedLeakCounter& layoutObjectCounter() |
| 238 { | 238 { |
| 239 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, (
"LayoutObject")); | 239 DEFINE_STATIC_LOCAL(WTF::RefCountedLeakCounter, staticLayoutObjectCounter, (
"LayoutObject")); |
| 240 return staticLayoutObjectCounter; | 240 return staticLayoutObjectCounter; |
| 241 } | 241 } |
| 242 #endif | 242 #endif |
| 243 | 243 |
| 244 LayoutObject::LayoutObject(Node* node) | 244 LayoutObject::LayoutObject(Node* node) |
| 245 : ImageResourceClient() | 245 : m_style(nullptr) |
| 246 , m_style(nullptr) | |
| 247 , m_node(node) | 246 , m_node(node) |
| 248 , m_parent(nullptr) | 247 , m_parent(nullptr) |
| 249 , m_previous(nullptr) | 248 , m_previous(nullptr) |
| 250 , m_next(nullptr) | 249 , m_next(nullptr) |
| 251 #if ENABLE(ASSERT) | 250 #if ENABLE(ASSERT) |
| 252 , m_hasAXObject(false) | 251 , m_hasAXObject(false) |
| 253 , m_setNeedsLayoutForbidden(false) | 252 , m_setNeedsLayoutForbidden(false) |
| 254 #endif | 253 #endif |
| 255 , m_bitfields(node) | 254 , m_bitfields(node) |
| 256 { | 255 { |
| (...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3174 LayoutBox* box = toLayoutBox(this); | 3173 LayoutBox* box = toLayoutBox(this); |
| 3175 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); | 3174 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); |
| 3176 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); | 3175 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); |
| 3177 | 3176 |
| 3178 AnnotatedRegionValue region; | 3177 AnnotatedRegionValue region; |
| 3179 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; | 3178 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; |
| 3180 region.bounds = LayoutRect(absBounds); | 3179 region.bounds = LayoutRect(absBounds); |
| 3181 regions.append(region); | 3180 regions.append(region); |
| 3182 } | 3181 } |
| 3183 | 3182 |
| 3184 bool LayoutObject::willRenderImage(ImageResource*) | 3183 bool LayoutObject::willRenderImage() |
| 3185 { | 3184 { |
| 3186 // Without visibility we won't render (and therefore don't care about animat
ion). | 3185 // Without visibility we won't render (and therefore don't care about animat
ion). |
| 3187 if (style()->visibility() != VISIBLE) | 3186 if (style()->visibility() != VISIBLE) |
| 3188 return false; | 3187 return false; |
| 3189 | 3188 |
| 3190 // We will not render a new image when Active DOM is suspended | 3189 // We will not render a new image when Active DOM is suspended |
| 3191 if (document().activeDOMObjectsAreSuspended()) | 3190 if (document().activeDOMObjectsAreSuspended()) |
| 3192 return false; | 3191 return false; |
| 3193 | 3192 |
| 3194 // If we're not in a window (i.e., we're dormant from being in a background
tab) | 3193 // If we're not in a window (i.e., we're dormant from being in a background
tab) |
| 3195 // then we don't want to render either. | 3194 // then we don't want to render either. |
| 3196 return document().view()->isVisible(); | 3195 return document().view()->isVisible(); |
| 3197 } | 3196 } |
| 3198 | 3197 |
| 3199 bool LayoutObject::getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&
policy) | 3198 bool LayoutObject::getImageAnimationPolicy(ImageAnimationPolicy& policy) |
| 3200 { | 3199 { |
| 3201 if (!document().settings()) | 3200 if (!document().settings()) |
| 3202 return false; | 3201 return false; |
| 3203 policy = document().settings()->imageAnimationPolicy(); | 3202 policy = document().settings()->imageAnimationPolicy(); |
| 3204 return true; | 3203 return true; |
| 3205 } | 3204 } |
| 3206 | 3205 |
| 3207 int LayoutObject::caretMinOffset() const | 3206 int LayoutObject::caretMinOffset() const |
| 3208 { | 3207 { |
| 3209 return 0; | 3208 return 0; |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3712 const blink::LayoutObject* root = object1; | 3711 const blink::LayoutObject* root = object1; |
| 3713 while (root->parent()) | 3712 while (root->parent()) |
| 3714 root = root->parent(); | 3713 root = root->parent(); |
| 3715 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3714 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3716 } else { | 3715 } else { |
| 3717 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3716 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3718 } | 3717 } |
| 3719 } | 3718 } |
| 3720 | 3719 |
| 3721 #endif | 3720 #endif |
| OLD | NEW |