OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 | 371 |
372 // FIXME: This function needs a better name and may belong in a different class. It's not | 372 // FIXME: This function needs a better name and may belong in a different class. It's not |
373 // really isContentEditable(); it's more like needsEditingContextMenu(). In many ways, this | 373 // really isContentEditable(); it's more like needsEditingContextMenu(). In many ways, this |
374 // function would make more sense in the ContextMenu class, except that WebEleme ntDictionary | 374 // function would make more sense in the ContextMenu class, except that WebEleme ntDictionary |
375 // hooks into it. Anyway, we should architect this better. | 375 // hooks into it. Anyway, we should architect this better. |
376 bool HitTestResult::isContentEditable() const | 376 bool HitTestResult::isContentEditable() const |
377 { | 377 { |
378 if (!m_innerNonSharedNode) | 378 if (!m_innerNonSharedNode) |
379 return false; | 379 return false; |
380 | 380 |
381 if (isHTMLTextAreaElement(*m_innerNonSharedNode)) | 381 if (isHTMLTextAreaElement(*m_innerNonSharedNode) && !toHTMLFormControlElemen t(m_innerNonSharedNode)->isDisabledOrReadOnly()) |
yosin_UTC9
2014/05/07 01:12:03
nit: Can we move |isDisabledOrReadOnly()| call to
| |
382 return true; | 382 return true; |
383 | 383 |
384 if (isHTMLInputElement(*m_innerNonSharedNode)) | 384 if (isHTMLInputElement(*m_innerNonSharedNode) && !toHTMLFormControlElement(m _innerNonSharedNode)->isDisabledOrReadOnly()) |
yosin_UTC9
2014/05/07 01:12:03
nit: Can we move |isDisabledOrReadOnly()| call to
| |
385 return toHTMLInputElement(*m_innerNonSharedNode).isTextField(); | 385 return toHTMLInputElement(*m_innerNonSharedNode).isTextField(); |
386 | 386 |
387 return m_innerNonSharedNode->rendererIsEditable(); | 387 return m_innerNonSharedNode->rendererIsEditable(); |
388 } | 388 } |
389 | 389 |
390 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) | 390 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) |
391 { | 391 { |
392 // If it is not a rect-based hit test, this method has to be no-op. | 392 // If it is not a rect-based hit test, this method has to be no-op. |
393 // Return false, so the hit test stops. | 393 // Return false, so the hit test stops. |
394 if (!isRectBasedTest()) | 394 if (!isRectBasedTest()) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 { | 485 { |
486 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { | 486 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { |
487 if (node->isElementNode()) | 487 if (node->isElementNode()) |
488 return toElement(node); | 488 return toElement(node); |
489 } | 489 } |
490 | 490 |
491 return 0; | 491 return 0; |
492 } | 492 } |
493 | 493 |
494 } // namespace WebCore | 494 } // namespace WebCore |
OLD | NEW |