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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // FIXME: This function needs a better name and may belong in a different class.
It's not | 374 // FIXME: This function needs a better name and may belong in a different class.
It's not |
375 // really isContentEditable(); it's more like needsEditingContextMenu(). In many
ways, this | 375 // really isContentEditable(); it's more like needsEditingContextMenu(). In many
ways, this |
376 // function would make more sense in the ContextMenu class, except that WebEleme
ntDictionary | 376 // function would make more sense in the ContextMenu class, except that WebEleme
ntDictionary |
377 // hooks into it. Anyway, we should architect this better. | 377 // hooks into it. Anyway, we should architect this better. |
378 bool HitTestResult::isContentEditable() const | 378 bool HitTestResult::isContentEditable() const |
379 { | 379 { |
380 if (!m_innerNonSharedNode) | 380 if (!m_innerNonSharedNode) |
381 return false; | 381 return false; |
382 | 382 |
383 if (isHTMLTextAreaElement(*m_innerNonSharedNode)) | 383 if (isHTMLTextAreaElement(*m_innerNonSharedNode)) |
384 return true; | 384 return !toHTMLFormControlElement(m_innerNonSharedNode)->isDisabledOrRead
Only(); |
385 | 385 |
386 if (isHTMLInputElement(*m_innerNonSharedNode)) | 386 if (isHTMLInputElement(*m_innerNonSharedNode)) |
387 return toHTMLInputElement(*m_innerNonSharedNode).isTextField(); | 387 return (!toHTMLFormControlElement(m_innerNonSharedNode)->isDisabledOrRea
dOnly() && toHTMLInputElement(*m_innerNonSharedNode).isTextField()); |
388 | 388 |
389 return m_innerNonSharedNode->rendererIsEditable(); | 389 return m_innerNonSharedNode->rendererIsEditable(); |
390 } | 390 } |
391 | 391 |
392 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) | 392 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) |
393 { | 393 { |
394 // If it is not a rect-based hit test, this method has to be no-op. | 394 // If it is not a rect-based hit test, this method has to be no-op. |
395 // Return false, so the hit test stops. | 395 // Return false, so the hit test stops. |
396 if (!isRectBasedTest()) | 396 if (!isRectBasedTest()) |
397 return false; | 397 return false; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 { | 487 { |
488 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { | 488 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { |
489 if (node->isElementNode()) | 489 if (node->isElementNode()) |
490 return toElement(node); | 490 return toElement(node); |
491 } | 491 } |
492 | 492 |
493 return 0; | 493 return 0; |
494 } | 494 } |
495 | 495 |
496 } // namespace WebCore | 496 } // namespace WebCore |
OLD | NEW |