| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); | 454 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); |
| 455 } | 455 } |
| 456 | 456 |
| 457 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const | 457 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const |
| 458 { | 458 { |
| 459 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but | 459 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but |
| 460 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion | 460 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion |
| 461 // would fire in the middle of Document::setFocusedNode(). | 461 // would fire in the middle of Document::setFocusedNode(). |
| 462 | 462 |
| 463 for (const Node* node = this; node; node = node->parentNode()) { | 463 for (const Node* node = this; node; node = node->parentNode()) { |
| 464 if (node->isHTMLElement() && node->renderer()) { | 464 if (node->isElementNode() && node->renderer()) { |
| 465 // Elements with user-select: all style are considered atomic | 465 // Elements with user-select: all style are considered atomic |
| 466 // therefore non editable. | 466 // therefore non editable. |
| 467 if (Position::nodeIsUserSelectAll(node) && treatment == UserSelectAl
lIsAlwaysNonEditable) | 467 if (Position::nodeIsUserSelectAll(node) && treatment == UserSelectAl
lIsAlwaysNonEditable) |
| 468 return false; | 468 return false; |
| 469 if (static_cast<const Element*>(node)->hasAttribute(HTMLNames::conte
nteditableAttr)) | 469 if (static_cast<const Element*>(node)->hasAttribute(HTMLNames::conte
nteditableAttr)) |
| 470 return editableLevel != RichlyEditable; | 470 return editableLevel != RichlyEditable; |
| 471 return false; | 471 return false; |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 | 474 |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 | 1619 |
| 1620 case WaitingForUpgrade: | 1620 case WaitingForUpgrade: |
| 1621 ASSERT(NotCustomElement == customElementState()); | 1621 ASSERT(NotCustomElement == customElementState()); |
| 1622 break; | 1622 break; |
| 1623 | 1623 |
| 1624 case Upgraded: | 1624 case Upgraded: |
| 1625 ASSERT(WaitingForUpgrade == customElementState()); | 1625 ASSERT(WaitingForUpgrade == customElementState()); |
| 1626 break; | 1626 break; |
| 1627 } | 1627 } |
| 1628 | 1628 |
| 1629 ASSERT(isHTMLElement()); | 1629 ASSERT(isElementNode()); |
| 1630 setFlag(CustomElementFlag); | 1630 setFlag(CustomElementFlag); |
| 1631 setFlag(newState == Upgraded, CustomElementUpgradedFlag); | 1631 setFlag(newState == Upgraded, CustomElementUpgradedFlag); |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 unsigned Node::lengthOfContents() const | 1634 unsigned Node::lengthOfContents() const |
| 1635 { | 1635 { |
| 1636 // This switch statement must be consistent with that of Range::processConte
ntsBetweenOffsets. | 1636 // This switch statement must be consistent with that of Range::processConte
ntsBetweenOffsets. |
| 1637 switch (nodeType()) { | 1637 switch (nodeType()) { |
| 1638 case Node::TEXT_NODE: | 1638 case Node::TEXT_NODE: |
| 1639 return toCharacterData(this)->length(); | 1639 return toCharacterData(this)->length(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1662 node->showTreeForThis(); | 1662 node->showTreeForThis(); |
| 1663 } | 1663 } |
| 1664 | 1664 |
| 1665 void showNodePath(const blink::Node* node) | 1665 void showNodePath(const blink::Node* node) |
| 1666 { | 1666 { |
| 1667 if (node) | 1667 if (node) |
| 1668 node->showNodePathForThis(); | 1668 node->showNodePathForThis(); |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 #endif | 1671 #endif |
| OLD | NEW |