| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 if (node == this) | 527 if (node == this) |
| 528 break; | 528 break; |
| 529 | 529 |
| 530 if (node->getNodeType() == TEXT_NODE) | 530 if (node->getNodeType() == TEXT_NODE) |
| 531 node = toText(node)->mergeNextSiblingNodesIfPossible(); | 531 node = toText(node)->mergeNextSiblingNodesIfPossible(); |
| 532 else | 532 else |
| 533 node = NodeTraversal::nextPostOrder(*node); | 533 node = NodeTraversal::nextPostOrder(*node); |
| 534 } | 534 } |
| 535 } | 535 } |
| 536 | 536 |
| 537 bool Node::isContentEditable(UserSelectAllTreatment treatment) const | 537 bool Node::isContentEditable() const |
| 538 { | 538 { |
| 539 document().updateStyleAndLayoutTree(); | 539 document().updateStyleAndLayoutTree(); |
| 540 return hasEditableStyle(Editable, treatment); | 540 return hasEditableStyle(Editable); |
| 541 } | 541 } |
| 542 | 542 |
| 543 bool Node::isContentRichlyEditable() const | 543 bool Node::isContentRichlyEditable() const |
| 544 { | 544 { |
| 545 document().updateStyleAndLayoutTree(); | 545 document().updateStyleAndLayoutTree(); |
| 546 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); | 546 return hasEditableStyle(RichlyEditable); |
| 547 } | 547 } |
| 548 | 548 |
| 549 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const | 549 bool Node::hasEditableStyle(EditableLevel editableLevel) const |
| 550 { | 550 { |
| 551 if (isPseudoElement()) | 551 if (isPseudoElement()) |
| 552 return false; | 552 return false; |
| 553 | 553 |
| 554 // Ideally we'd call DCHECK(!needsStyleRecalc()) here, but | 554 // Ideally we'd call DCHECK(!needsStyleRecalc()) here, but |
| 555 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion | 555 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion |
| 556 // would fire in the middle of Document::setFocusedNode(). | 556 // would fire in the middle of Document::setFocusedNode(). |
| 557 | 557 |
| 558 for (const Node& node : NodeTraversal::inclusiveAncestorsOf(*this)) { | 558 for (const Node& node : NodeTraversal::inclusiveAncestorsOf(*this)) { |
| 559 if ((node.isHTMLElement() || node.isDocumentNode()) && node.layoutObject
()) { | 559 if ((node.isHTMLElement() || node.isDocumentNode()) && node.layoutObject
()) { |
| (...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2194 { | 2194 { |
| 2195 if (isDisabledFormControl(this)) | 2195 if (isDisabledFormControl(this)) |
| 2196 return false; | 2196 return false; |
| 2197 return hasEventListeners(EventTypeNames::mousemove) || hasEventListeners(Eve
ntTypeNames::mouseover) || hasEventListeners(EventTypeNames::mouseout); | 2197 return hasEventListeners(EventTypeNames::mousemove) || hasEventListeners(Eve
ntTypeNames::mouseover) || hasEventListeners(EventTypeNames::mouseout); |
| 2198 } | 2198 } |
| 2199 | 2199 |
| 2200 bool Node::willRespondToMouseClickEvents() | 2200 bool Node::willRespondToMouseClickEvents() |
| 2201 { | 2201 { |
| 2202 if (isDisabledFormControl(this)) | 2202 if (isDisabledFormControl(this)) |
| 2203 return false; | 2203 return false; |
| 2204 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen
ers(EventTypeNames::mouseup) || hasEventListeners(EventTypeNames::mousedown) ||
hasEventListeners(EventTypeNames::click) || hasEventListeners(EventTypeNames::DO
MActivate); | 2204 return isContentEditable() || hasEventListeners(EventTypeNames::mouseup) ||
hasEventListeners(EventTypeNames::mousedown) || hasEventListeners(EventTypeNames
::click) || hasEventListeners(EventTypeNames::DOMActivate); |
| 2205 } | 2205 } |
| 2206 | 2206 |
| 2207 bool Node::willRespondToTouchEvents() | 2207 bool Node::willRespondToTouchEvents() |
| 2208 { | 2208 { |
| 2209 if (isDisabledFormControl(this)) | 2209 if (isDisabledFormControl(this)) |
| 2210 return false; | 2210 return false; |
| 2211 return hasEventListeners(EventTypeNames::touchstart) || hasEventListeners(Ev
entTypeNames::touchmove) || hasEventListeners(EventTypeNames::touchcancel) || ha
sEventListeners(EventTypeNames::touchend); | 2211 return hasEventListeners(EventTypeNames::touchstart) || hasEventListeners(Ev
entTypeNames::touchmove) || hasEventListeners(EventTypeNames::touchcancel) || ha
sEventListeners(EventTypeNames::touchend); |
| 2212 } | 2212 } |
| 2213 | 2213 |
| 2214 unsigned Node::connectedSubframeCount() const | 2214 unsigned Node::connectedSubframeCount() const |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 | 2500 |
| 2501 void showNodePath(const blink::Node* node) | 2501 void showNodePath(const blink::Node* node) |
| 2502 { | 2502 { |
| 2503 if (node) | 2503 if (node) |
| 2504 node->showNodePathForThis(); | 2504 node->showNodePathForThis(); |
| 2505 else | 2505 else |
| 2506 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2506 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2507 } | 2507 } |
| 2508 | 2508 |
| 2509 #endif | 2509 #endif |
| OLD | NEW |