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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 return; | 858 return; |
859 | 859 |
860 StyleChangeType existingChangeType = styleChangeType(); | 860 StyleChangeType existingChangeType = styleChangeType(); |
861 if (changeType > existingChangeType) | 861 if (changeType > existingChangeType) |
862 setStyleChange(changeType); | 862 setStyleChange(changeType); |
863 | 863 |
864 if (existingChangeType == NoStyleChange) | 864 if (existingChangeType == NoStyleChange) |
865 markAncestorsWithChildNeedsStyleRecalc(); | 865 markAncestorsWithChildNeedsStyleRecalc(); |
866 } | 866 } |
867 | 867 |
868 void Node::lazyAttach(ShouldSetAttached shouldSetAttached) | 868 void Node::lazyAttach() |
869 { | 869 { |
870 for (Node* n = this; n; n = NodeTraversal::next(n, this)) { | 870 // It's safe to synchronously attach here because we're in the middle of sty
le recalc |
871 if (n->hasChildNodes()) | 871 // while it's not safe to mark nodes as needing style recalc except in the l
oop in |
872 n->setChildNeedsStyleRecalc(); | 872 // Element::recalcStyle because we may mark an ancestor as not needing recal
c and |
873 n->setStyleChange(FullStyleChange); | 873 // then the node would never get updated. One place this currently happens i
s |
874 if (shouldSetAttached == SetAttached) | 874 // HTMLObjectElement::renderFallbackContent which may call lazyAttach from i
nside |
875 n->setAttached(); | 875 // attach which was triggered by a recalcStyle. |
| 876 if (document()->inStyleRecalc()) { |
| 877 attach(); |
| 878 return; |
876 } | 879 } |
| 880 setStyleChange(FullStyleChange); |
877 markAncestorsWithChildNeedsStyleRecalc(); | 881 markAncestorsWithChildNeedsStyleRecalc(); |
878 } | 882 } |
879 | 883 |
880 bool Node::supportsFocus() const | 884 bool Node::supportsFocus() const |
881 { | 885 { |
882 return false; | 886 return false; |
883 } | 887 } |
884 | 888 |
885 bool Node::isFocusable() const | 889 bool Node::isFocusable() const |
886 { | 890 { |
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2771 node->showTreeForThis(); | 2775 node->showTreeForThis(); |
2772 } | 2776 } |
2773 | 2777 |
2774 void showNodePath(const WebCore::Node* node) | 2778 void showNodePath(const WebCore::Node* node) |
2775 { | 2779 { |
2776 if (node) | 2780 if (node) |
2777 node->showNodePathForThis(); | 2781 node->showNodePathForThis(); |
2778 } | 2782 } |
2779 | 2783 |
2780 #endif | 2784 #endif |
OLD | NEW |