Chromium Code Reviews| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 ()) { |
| 560 const bool isContentEditable = node.isHTMLElement() && toHTMLElement (node).contentEditable() == "true"; | |
|
yosin_UTC9
2016/07/06 07:56:48
We should not check "contentEditable" attribute. e
yoichio
2016/07/07 07:57:02
Done.
| |
| 560 // Elements with user-select: all style are considered atomic | 561 // Elements with user-select: all style are considered atomic |
| 561 // therefore non editable. | 562 // therefore non editable. |
| 562 if (nodeIsUserSelectAll(&node) && treatment == UserSelectAllIsAlways NonEditable) | 563 if (!isContentEditable && nodeIsUserSelectAll(&node) && treatment == UserSelectAllIsAlwaysNonEditable) |
| 563 return false; | 564 return false; |
| 564 switch (node.layoutObject()->style()->userModify()) { | 565 switch (node.layoutObject()->style()->userModify()) { |
| 565 case READ_ONLY: | 566 case READ_ONLY: |
| 566 return false; | 567 return false; |
| 567 case READ_WRITE: | 568 case READ_WRITE: |
| 568 return true; | 569 return true; |
| 569 case READ_WRITE_PLAINTEXT_ONLY: | 570 case READ_WRITE_PLAINTEXT_ONLY: |
| 570 return editableLevel != RichlyEditable; | 571 return editableLevel != RichlyEditable; |
| 571 } | 572 } |
| 572 ASSERT_NOT_REACHED(); | 573 ASSERT_NOT_REACHED(); |
| (...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2501 | 2502 |
| 2502 void showNodePath(const blink::Node* node) | 2503 void showNodePath(const blink::Node* node) |
| 2503 { | 2504 { |
| 2504 if (node) | 2505 if (node) |
| 2505 node->showNodePathForThis(); | 2506 node->showNodePathForThis(); |
| 2506 else | 2507 else |
| 2507 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2508 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2508 } | 2509 } |
| 2509 | 2510 |
| 2510 #endif | 2511 #endif |
| OLD | NEW |