| 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-2011, 2014 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 7 * (http://www.torchmobile.com/) | 7 * (http://www.torchmobile.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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // Note: As a shadow host whose root with delegatesFocus=false may become | 387 // Note: As a shadow host whose root with delegatesFocus=false may become |
| 388 // focused state when an inner element gets focused, in that case more than | 388 // focused state when an inner element gets focused, in that case more than |
| 389 // one elements in a document can return true for |isFocused()|. Use | 389 // one elements in a document can return true for |isFocused()|. Use |
| 390 // Element::isFocusedElementInDocument() or Document::focusedElement() to | 390 // Element::isFocusedElementInDocument() or Document::focusedElement() to |
| 391 // check which element is exactly focused. | 391 // check which element is exactly focused. |
| 392 bool isFocused() const { | 392 bool isFocused() const { |
| 393 return isUserActionElement() && isUserActionElementFocused(); | 393 return isUserActionElement() && isUserActionElementFocused(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 bool needsAttach() const { | 396 bool needsAttach() const { |
| 397 return getStyleChangeType() == NeedsReattachStyleChange; | 397 return getStyleChangeType() == NeedsReattachStyleChange || |
| 398 getFlag(NeedsReattachLayoutTree); |
| 398 } | 399 } |
| 399 bool needsStyleRecalc() const { | 400 bool needsStyleRecalc() const { |
| 400 return getStyleChangeType() != NoStyleChange; | 401 return getStyleChangeType() != NoStyleChange; |
| 401 } | 402 } |
| 402 StyleChangeType getStyleChangeType() const { | 403 StyleChangeType getStyleChangeType() const { |
| 403 return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); | 404 return static_cast<StyleChangeType>(m_nodeFlags & StyleChangeMask); |
| 404 } | 405 } |
| 405 bool childNeedsStyleRecalc() const { | 406 bool childNeedsStyleRecalc() const { |
| 406 return getFlag(ChildNeedsStyleRecalcFlag); | 407 return getFlag(ChildNeedsStyleRecalcFlag); |
| 407 } | 408 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 420 | 421 |
| 421 void setNeedsStyleRecalc(StyleChangeType, const StyleChangeReasonForTracing&); | 422 void setNeedsStyleRecalc(StyleChangeType, const StyleChangeReasonForTracing&); |
| 422 void clearNeedsStyleRecalc(); | 423 void clearNeedsStyleRecalc(); |
| 423 | 424 |
| 424 bool needsReattachLayoutTree() { return getFlag(NeedsReattachLayoutTree); } | 425 bool needsReattachLayoutTree() { return getFlag(NeedsReattachLayoutTree); } |
| 425 bool childNeedsReattachLayoutTree() { | 426 bool childNeedsReattachLayoutTree() { |
| 426 return getFlag(ChildNeedsReattachLayoutTree); | 427 return getFlag(ChildNeedsReattachLayoutTree); |
| 427 } | 428 } |
| 428 | 429 |
| 429 void setNeedsReattachLayoutTree(); | 430 void setNeedsReattachLayoutTree(); |
| 431 void setLocalNeedsReattachLayoutTree() { setFlag(NeedsReattachLayoutTree); } |
| 430 void setChildNeedsReattachLayoutTree() { | 432 void setChildNeedsReattachLayoutTree() { |
| 431 setFlag(ChildNeedsReattachLayoutTree); | 433 setFlag(ChildNeedsReattachLayoutTree); |
| 432 } | 434 } |
| 433 | 435 |
| 434 void clearNeedsReattachLayoutTree() { clearFlag(NeedsReattachLayoutTree); } | 436 void clearNeedsReattachLayoutTree() { clearFlag(NeedsReattachLayoutTree); } |
| 435 void clearChildNeedsReattachLayoutTree() { | 437 void clearChildNeedsReattachLayoutTree() { |
| 436 clearFlag(ChildNeedsReattachLayoutTree); | 438 clearFlag(ChildNeedsReattachLayoutTree); |
| 437 } | 439 } |
| 438 | 440 |
| 439 void markAncestorsWithChildNeedsReattachLayoutTree(); | 441 void markAncestorsWithChildNeedsReattachLayoutTree(); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 | 824 |
| 823 HasNameOrIsEditingTextFlag = 1 << 22, | 825 HasNameOrIsEditingTextFlag = 1 << 22, |
| 824 HasEventTargetDataFlag = 1 << 23, | 826 HasEventTargetDataFlag = 1 << 23, |
| 825 | 827 |
| 826 V0CustomElementFlag = 1 << 24, | 828 V0CustomElementFlag = 1 << 24, |
| 827 V0CustomElementUpgradedFlag = 1 << 25, | 829 V0CustomElementUpgradedFlag = 1 << 25, |
| 828 | 830 |
| 829 NeedsReattachLayoutTree = 1 << 26, | 831 NeedsReattachLayoutTree = 1 << 26, |
| 830 ChildNeedsReattachLayoutTree = 1 << 27, | 832 ChildNeedsReattachLayoutTree = 1 << 27, |
| 831 | 833 |
| 832 DefaultNodeFlags = IsFinishedParsingChildrenFlag | NeedsReattachStyleChange | 834 DefaultNodeFlags = IsFinishedParsingChildrenFlag | |
| 835 NeedsReattachStyleChange | |
| 836 NeedsReattachLayoutTree |
| 833 }; | 837 }; |
| 834 | 838 |
| 835 // 4 bits remaining. | 839 // 4 bits remaining. |
| 836 | 840 |
| 837 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } | 841 bool getFlag(NodeFlags mask) const { return m_nodeFlags & mask; } |
| 838 void setFlag(bool f, NodeFlags mask) { | 842 void setFlag(bool f, NodeFlags mask) { |
| 839 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); | 843 m_nodeFlags = (m_nodeFlags & ~mask) | (-(int32_t)f & mask); |
| 840 } | 844 } |
| 841 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } | 845 void setFlag(NodeFlags mask) { m_nodeFlags |= mask; } |
| 842 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } | 846 void clearFlag(NodeFlags mask) { m_nodeFlags &= ~mask; } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 } // namespace blink | 1021 } // namespace blink |
| 1018 | 1022 |
| 1019 #ifndef NDEBUG | 1023 #ifndef NDEBUG |
| 1020 // Outside the WebCore namespace for ease of invocation from gdb. | 1024 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1021 void showNode(const blink::Node*); | 1025 void showNode(const blink::Node*); |
| 1022 void showTree(const blink::Node*); | 1026 void showTree(const blink::Node*); |
| 1023 void showNodePath(const blink::Node*); | 1027 void showNodePath(const blink::Node*); |
| 1024 #endif | 1028 #endif |
| 1025 | 1029 |
| 1026 #endif // Node_h | 1030 #endif // Node_h |
| OLD | NEW |