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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 return nullAtom; | 493 return nullAtom; |
494 } | 494 } |
495 | 495 |
496 const AtomicString& Node::namespaceURI() const | 496 const AtomicString& Node::namespaceURI() const |
497 { | 497 { |
498 return nullAtom; | 498 return nullAtom; |
499 } | 499 } |
500 | 500 |
501 bool Node::isContentEditable(UserSelectAllTreatment treatment) | 501 bool Node::isContentEditable(UserSelectAllTreatment treatment) |
502 { | 502 { |
503 document().updateStyleIfNeeded(); | 503 document().updateRenderTreeIfNeeded(); |
504 return rendererIsEditable(Editable, treatment); | 504 return rendererIsEditable(Editable, treatment); |
505 } | 505 } |
506 | 506 |
507 bool Node::isContentRichlyEditable() | 507 bool Node::isContentRichlyEditable() |
508 { | 508 { |
509 document().updateStyleIfNeeded(); | 509 document().updateRenderTreeIfNeeded(); |
510 return rendererIsEditable(RichlyEditable, UserSelectAllIsAlwaysNonEditable); | 510 return rendererIsEditable(RichlyEditable, UserSelectAllIsAlwaysNonEditable); |
511 } | 511 } |
512 | 512 |
513 bool Node::rendererIsEditable(EditableLevel editableLevel, UserSelectAllTreatmen
t treatment) const | 513 bool Node::rendererIsEditable(EditableLevel editableLevel, UserSelectAllTreatmen
t treatment) const |
514 { | 514 { |
515 if (isPseudoElement()) | 515 if (isPseudoElement()) |
516 return false; | 516 return false; |
517 | 517 |
518 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but | 518 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but |
519 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion | 519 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 { | 644 { |
645 setFlag(NeedsStyleInvalidation); | 645 setFlag(NeedsStyleInvalidation); |
646 markAncestorsWithChildNeedsStyleInvalidation(); | 646 markAncestorsWithChildNeedsStyleInvalidation(); |
647 } | 647 } |
648 | 648 |
649 void Node::markAncestorsWithChildNeedsStyleInvalidation() | 649 void Node::markAncestorsWithChildNeedsStyleInvalidation() |
650 { | 650 { |
651 for (Node* node = parentOrShadowHostNode(); node && !node->childNeedsStyleIn
validation(); node = node->parentOrShadowHostNode()) | 651 for (Node* node = parentOrShadowHostNode(); node && !node->childNeedsStyleIn
validation(); node = node->parentOrShadowHostNode()) |
652 node->setChildNeedsStyleInvalidation(); | 652 node->setChildNeedsStyleInvalidation(); |
653 if (document().childNeedsStyleInvalidation()) | 653 if (document().childNeedsStyleInvalidation()) |
654 document().scheduleStyleRecalc(); | 654 document().scheduleRenderTreeUpdate(); |
655 } | 655 } |
656 | 656 |
657 void Node::markAncestorsWithChildNeedsDistributionRecalc() | 657 void Node::markAncestorsWithChildNeedsDistributionRecalc() |
658 { | 658 { |
659 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node
= node->parentOrShadowHostNode()) | 659 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node
= node->parentOrShadowHostNode()) |
660 node->setChildNeedsDistributionRecalc(); | 660 node->setChildNeedsDistributionRecalc(); |
661 if (document().childNeedsDistributionRecalc()) | 661 if (document().childNeedsDistributionRecalc()) |
662 document().scheduleStyleRecalc(); | 662 document().scheduleRenderTreeUpdate(); |
663 } | 663 } |
664 | 664 |
665 namespace { | 665 namespace { |
666 | 666 |
667 unsigned styledSubtreeSize(const Node*); | 667 unsigned styledSubtreeSize(const Node*); |
668 | 668 |
669 unsigned styledSubtreeSizeIgnoringSelfAndShadowRoots(const Node* rootNode) | 669 unsigned styledSubtreeSizeIgnoringSelfAndShadowRoots(const Node* rootNode) |
670 { | 670 { |
671 unsigned nodeCount = 0; | 671 unsigned nodeCount = 0; |
672 for (Node* child = rootNode->firstChild(); child; child = child->nextSibling
()) | 672 for (Node* child = rootNode->firstChild(); child; child = child->nextSibling
()) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 { | 739 { |
740 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; | 740 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; |
741 } | 741 } |
742 | 742 |
743 void Node::markAncestorsWithChildNeedsStyleRecalc() | 743 void Node::markAncestorsWithChildNeedsStyleRecalc() |
744 { | 744 { |
745 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe
calc(); p = p->parentOrShadowHostNode()) | 745 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe
calc(); p = p->parentOrShadowHostNode()) |
746 p->setChildNeedsStyleRecalc(); | 746 p->setChildNeedsStyleRecalc(); |
747 | 747 |
748 if (document().needsStyleRecalc() || document().childNeedsStyleRecalc()) | 748 if (document().needsStyleRecalc() || document().childNeedsStyleRecalc()) |
749 document().scheduleStyleRecalc(); | 749 document().scheduleRenderTreeUpdate(); |
750 } | 750 } |
751 | 751 |
752 void Node::setNeedsStyleRecalc(StyleChangeType changeType) | 752 void Node::setNeedsStyleRecalc(StyleChangeType changeType) |
753 { | 753 { |
754 ASSERT(changeType != NoStyleChange); | 754 ASSERT(changeType != NoStyleChange); |
755 if (!inActiveDocument()) | 755 if (!inActiveDocument()) |
756 return; | 756 return; |
757 | 757 |
758 StyleChangeType existingChangeType = styleChangeType(); | 758 StyleChangeType existingChangeType = styleChangeType(); |
759 if (changeType > existingChangeType) { | 759 if (changeType > existingChangeType) { |
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2539 node->showTreeForThis(); | 2539 node->showTreeForThis(); |
2540 } | 2540 } |
2541 | 2541 |
2542 void showNodePath(const WebCore::Node* node) | 2542 void showNodePath(const WebCore::Node* node) |
2543 { | 2543 { |
2544 if (node) | 2544 if (node) |
2545 node->showNodePathForThis(); | 2545 node->showNodePathForThis(); |
2546 } | 2546 } |
2547 | 2547 |
2548 #endif | 2548 #endif |
OLD | NEW |