| 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 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3206 ASSERT(m_node); | 3206 ASSERT(m_node); |
| 3207 | 3207 |
| 3208 // Image change notifications should not be received during paint because | 3208 // Image change notifications should not be received during paint because |
| 3209 // the resulting invalidations will be cleared following paint. This can als
o | 3209 // the resulting invalidations will be cleared following paint. This can als
o |
| 3210 // lead to modifying the tree out from under paint(), see: crbug.com/616700. | 3210 // lead to modifying the tree out from under paint(), see: crbug.com/616700. |
| 3211 DCHECK(document().lifecycle().state() != DocumentLifecycle::LifecycleState::
InPaint); | 3211 DCHECK(document().lifecycle().state() != DocumentLifecycle::LifecycleState::
InPaint); |
| 3212 | 3212 |
| 3213 imageChanged(static_cast<WrappedImagePtr>(image), rect); | 3213 imageChanged(static_cast<WrappedImagePtr>(image), rect); |
| 3214 } | 3214 } |
| 3215 | 3215 |
| 3216 Element* LayoutObject::offsetParent(const Element* unclosedBase) const | 3216 Element* LayoutObject::offsetParent() const |
| 3217 { | 3217 { |
| 3218 if (isDocumentElement() || isBody()) | 3218 if (isDocumentElement() || isBody()) |
| 3219 return nullptr; | 3219 return nullptr; |
| 3220 | 3220 |
| 3221 if (isFixedPositioned()) | 3221 if (isOutOfFlowPositioned() && style()->position() == FixedPosition) |
| 3222 return nullptr; | 3222 return nullptr; |
| 3223 | 3223 |
| 3224 float effectiveZoom = style()->effectiveZoom(); | 3224 float effectiveZoom = style()->effectiveZoom(); |
| 3225 Node* node = nullptr; | 3225 Node* node = nullptr; |
| 3226 for (LayoutObject* ancestor = parent(); ancestor; ancestor = ancestor->paren
t()) { | 3226 for (LayoutObject* ancestor = parent(); ancestor; ancestor = ancestor->paren
t()) { |
| 3227 // Spec: http://www.w3.org/TR/cssom-view/#offset-attributes | 3227 // Spec: http://www.w3.org/TR/cssom-view/#offset-attributes |
| 3228 | 3228 |
| 3229 node = ancestor->node(); | 3229 node = ancestor->node(); |
| 3230 | 3230 |
| 3231 if (!node) | 3231 if (!node) |
| 3232 continue; | 3232 continue; |
| 3233 | 3233 |
| 3234 // TODO(kochi): If |unclosedBase| or |node| is nested deep in shadow roo
ts, this loop may | |
| 3235 // get expensive, as isUnclosedNodeOf() can take up to O(N+M) time (N an
d M are depths). | |
| 3236 if (unclosedBase && (!node->isUnclosedNodeOf(*unclosedBase) || (node->is
InShadowTree() && node->containingShadowRoot()->type() == ShadowRootType::UserAg
ent))) { | |
| 3237 // If 'position: fixed' node is found while traversing up, terminate
the loop and | |
| 3238 // return null. | |
| 3239 if (ancestor->isFixedPositioned()) | |
| 3240 return nullptr; | |
| 3241 continue; | |
| 3242 } | |
| 3243 | |
| 3244 if (ancestor->isPositioned()) | 3234 if (ancestor->isPositioned()) |
| 3245 break; | 3235 break; |
| 3246 | 3236 |
| 3247 if (isHTMLBodyElement(*node)) | 3237 if (isHTMLBodyElement(*node)) |
| 3248 break; | 3238 break; |
| 3249 | 3239 |
| 3250 if (!isPositioned() && (isHTMLTableElement(*node) || isHTMLTableCellElem
ent(*node))) | 3240 if (!isPositioned() && (isHTMLTableElement(*node) || isHTMLTableCellElem
ent(*node))) |
| 3251 break; | 3241 break; |
| 3252 | 3242 |
| 3253 // Webkit specific extension where offsetParent stops at zoom level chan
ges. | 3243 // Webkit specific extension where offsetParent stops at zoom level chan
ges. |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3674 const blink::LayoutObject* root = object1; | 3664 const blink::LayoutObject* root = object1; |
| 3675 while (root->parent()) | 3665 while (root->parent()) |
| 3676 root = root->parent(); | 3666 root = root->parent(); |
| 3677 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3667 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3678 } else { | 3668 } else { |
| 3679 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3669 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3680 } | 3670 } |
| 3681 } | 3671 } |
| 3682 | 3672 |
| 3683 #endif | 3673 #endif |
| OLD | NEW |