| 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); | 393 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); |
| 394 } | 394 } |
| 395 | 395 |
| 396 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const | 396 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const |
| 397 { | 397 { |
| 398 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but | 398 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but |
| 399 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion | 399 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion |
| 400 // would fire in the middle of Document::setFocusedNode(). | 400 // would fire in the middle of Document::setFocusedNode(). |
| 401 | 401 |
| 402 for (const Node* node = this; node; node = node->parentNode()) { | 402 for (const Node* node = this; node; node = node->parentNode()) { |
| 403 if ((node->isHTMLElement() || node->isDocumentNode()) && node->renderer(
)) { | 403 if (node->isHTMLElement() && node->renderer()) { |
| 404 // Elements with user-select: all style are considered atomic | 404 // Elements with user-select: all style are considered atomic |
| 405 // therefore non editable. | 405 // therefore non editable. |
| 406 if (Position::nodeIsUserSelectAll(node) && treatment == UserSelectAl
lIsAlwaysNonEditable) | 406 if (Position::nodeIsUserSelectAll(node) && treatment == UserSelectAl
lIsAlwaysNonEditable) |
| 407 return false; | 407 return false; |
| 408 switch (node->renderer()->style()->userModify()) { | 408 if (static_cast<const Element*>(node)->hasAttribute(HTMLNames::conte
nteditableAttr)) |
| 409 case READ_ONLY: | |
| 410 return false; | |
| 411 case READ_WRITE: | |
| 412 return true; | |
| 413 case READ_WRITE_PLAINTEXT_ONLY: | |
| 414 return editableLevel != RichlyEditable; | 409 return editableLevel != RichlyEditable; |
| 415 } | |
| 416 ASSERT_NOT_REACHED(); | |
| 417 return false; | 410 return false; |
| 418 } | 411 } |
| 419 } | 412 } |
| 420 | 413 |
| 421 return false; | 414 return false; |
| 422 } | 415 } |
| 423 | 416 |
| 424 bool Node::isEditableToAccessibility(EditableLevel editableLevel) const | 417 bool Node::isEditableToAccessibility(EditableLevel editableLevel) const |
| 425 { | 418 { |
| 426 return hasEditableStyle(editableLevel); | 419 return hasEditableStyle(editableLevel); |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 node->showTreeForThis(); | 1850 node->showTreeForThis(); |
| 1858 } | 1851 } |
| 1859 | 1852 |
| 1860 void showNodePath(const blink::Node* node) | 1853 void showNodePath(const blink::Node* node) |
| 1861 { | 1854 { |
| 1862 if (node) | 1855 if (node) |
| 1863 node->showNodePathForThis(); | 1856 node->showNodePathForThis(); |
| 1864 } | 1857 } |
| 1865 | 1858 |
| 1866 #endif | 1859 #endif |
| OLD | NEW |