| 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 15 matching lines...) Expand all Loading... |
| 26 #include "core/dom/DocumentMarkerController.h" | 26 #include "core/dom/DocumentMarkerController.h" |
| 27 #include "core/dom/NodeRenderingTraversal.h" | 27 #include "core/dom/NodeRenderingTraversal.h" |
| 28 #include "core/dom/shadow/ShadowRoot.h" | 28 #include "core/dom/shadow/ShadowRoot.h" |
| 29 #include "core/editing/FrameSelection.h" | 29 #include "core/editing/FrameSelection.h" |
| 30 #include "core/fetch/ImageResource.h" | 30 #include "core/fetch/ImageResource.h" |
| 31 #include "core/frame/LocalFrame.h" | 31 #include "core/frame/LocalFrame.h" |
| 32 #include "core/html/HTMLAnchorElement.h" | 32 #include "core/html/HTMLAnchorElement.h" |
| 33 #include "core/html/HTMLImageElement.h" | 33 #include "core/html/HTMLImageElement.h" |
| 34 #include "core/html/HTMLInputElement.h" | 34 #include "core/html/HTMLInputElement.h" |
| 35 #include "core/html/HTMLMediaElement.h" | 35 #include "core/html/HTMLMediaElement.h" |
| 36 #include "core/html/HTMLTextAreaElement.h" |
| 36 #include "core/html/parser/HTMLParserIdioms.h" | 37 #include "core/html/parser/HTMLParserIdioms.h" |
| 37 #include "core/page/FrameTree.h" | 38 #include "core/page/FrameTree.h" |
| 38 #include "core/rendering/RenderImage.h" | 39 #include "core/rendering/RenderImage.h" |
| 39 #include "core/rendering/RenderTextFragment.h" | 40 #include "core/rendering/RenderTextFragment.h" |
| 40 #include "core/svg/SVGElement.h" | 41 #include "core/svg/SVGElement.h" |
| 41 #include "platform/scroll/Scrollbar.h" | 42 #include "platform/scroll/Scrollbar.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 using namespace HTMLNames; | 46 using namespace HTMLNames; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // FIXME: This function needs a better name and may belong in a different class.
It's not | 365 // FIXME: This function needs a better name and may belong in a different class.
It's not |
| 365 // really isContentEditable(); it's more like needsEditingContextMenu(). In many
ways, this | 366 // really isContentEditable(); it's more like needsEditingContextMenu(). In many
ways, this |
| 366 // function would make more sense in the ContextMenu class, except that WebEleme
ntDictionary | 367 // function would make more sense in the ContextMenu class, except that WebEleme
ntDictionary |
| 367 // hooks into it. Anyway, we should architect this better. | 368 // hooks into it. Anyway, we should architect this better. |
| 368 bool HitTestResult::isContentEditable() const | 369 bool HitTestResult::isContentEditable() const |
| 369 { | 370 { |
| 370 if (!m_innerNonSharedNode) | 371 if (!m_innerNonSharedNode) |
| 371 return false; | 372 return false; |
| 372 | 373 |
| 373 if (isHTMLTextAreaElement(*m_innerNonSharedNode)) | 374 if (isHTMLTextAreaElement(*m_innerNonSharedNode)) |
| 374 return true; | 375 return !toHTMLTextAreaElement(*m_innerNonSharedNode).isDisabledOrReadOnl
y(); |
| 375 | 376 |
| 376 if (isHTMLInputElement(*m_innerNonSharedNode)) | 377 if (isHTMLInputElement(*m_innerNonSharedNode)) { |
| 377 return toHTMLInputElement(*m_innerNonSharedNode).isTextField(); | 378 HTMLInputElement& inputElement = toHTMLInputElement(*m_innerNonSharedNod
e); |
| 379 return !inputElement.isDisabledOrReadOnly() && inputElement.isTextField(
); |
| 380 } |
| 378 | 381 |
| 379 return m_innerNonSharedNode->hasEditableStyle(); | 382 return m_innerNonSharedNode->hasEditableStyle(); |
| 380 } | 383 } |
| 381 | 384 |
| 382 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) | 385 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) |
| 383 { | 386 { |
| 384 // If it is not a rect-based hit test, this method has to be no-op. | 387 // If it is not a rect-based hit test, this method has to be no-op. |
| 385 // Return false, so the hit test stops. | 388 // Return false, so the hit test stops. |
| 386 if (!isRectBasedTest()) | 389 if (!isRectBasedTest()) |
| 387 return false; | 390 return false; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 { | 477 { |
| 475 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { | 478 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa
rent(node)) { |
| 476 if (node->isElementNode()) | 479 if (node->isElementNode()) |
| 477 return toElement(node); | 480 return toElement(node); |
| 478 } | 481 } |
| 479 | 482 |
| 480 return 0; | 483 return 0; |
| 481 } | 484 } |
| 482 | 485 |
| 483 } // namespace blink | 486 } // namespace blink |
| OLD | NEW |