Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: Source/core/rendering/HitTestResult.cpp

Issue 19096009: Use isHTMLTextAreaElement and toHTMLTextAreaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 16 matching lines...) Expand all
27 #include "XLinkNames.h" 27 #include "XLinkNames.h"
28 #include "core/dom/DocumentMarkerController.h" 28 #include "core/dom/DocumentMarkerController.h"
29 #include "core/dom/NodeRenderingTraversal.h" 29 #include "core/dom/NodeRenderingTraversal.h"
30 #include "core/dom/shadow/ShadowRoot.h" 30 #include "core/dom/shadow/ShadowRoot.h"
31 #include "core/editing/FrameSelection.h" 31 #include "core/editing/FrameSelection.h"
32 #include "core/html/HTMLAnchorElement.h" 32 #include "core/html/HTMLAnchorElement.h"
33 #include "core/html/HTMLAreaElement.h" 33 #include "core/html/HTMLAreaElement.h"
34 #include "core/html/HTMLImageElement.h" 34 #include "core/html/HTMLImageElement.h"
35 #include "core/html/HTMLInputElement.h" 35 #include "core/html/HTMLInputElement.h"
36 #include "core/html/HTMLMediaElement.h" 36 #include "core/html/HTMLMediaElement.h"
37 #include "core/html/HTMLTextAreaElement.h"
37 #include "core/html/HTMLVideoElement.h" 38 #include "core/html/HTMLVideoElement.h"
38 #include "core/html/parser/HTMLParserIdioms.h" 39 #include "core/html/parser/HTMLParserIdioms.h"
39 #include "core/loader/cache/CachedImage.h" 40 #include "core/loader/cache/CachedImage.h"
40 #include "core/page/Frame.h" 41 #include "core/page/Frame.h"
41 #include "core/page/FrameTree.h" 42 #include "core/page/FrameTree.h"
42 #include "core/platform/Scrollbar.h" 43 #include "core/platform/Scrollbar.h"
43 #include "core/rendering/HitTestLocation.h" 44 #include "core/rendering/HitTestLocation.h"
44 #include "core/rendering/RenderImage.h" 45 #include "core/rendering/RenderImage.h"
45 46
46 namespace WebCore { 47 namespace WebCore {
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 379
379 // FIXME: This function needs a better name and may belong in a different class. It's not 380 // FIXME: This function needs a better name and may belong in a different class. It's not
380 // really isContentEditable(); it's more like needsEditingContextMenu(). In many ways, this 381 // really isContentEditable(); it's more like needsEditingContextMenu(). In many ways, this
381 // function would make more sense in the ContextMenu class, except that WebEleme ntDictionary 382 // function would make more sense in the ContextMenu class, except that WebEleme ntDictionary
382 // hooks into it. Anyway, we should architect this better. 383 // hooks into it. Anyway, we should architect this better.
383 bool HitTestResult::isContentEditable() const 384 bool HitTestResult::isContentEditable() const
384 { 385 {
385 if (!m_innerNonSharedNode) 386 if (!m_innerNonSharedNode)
386 return false; 387 return false;
387 388
388 if (m_innerNonSharedNode->hasTagName(textareaTag)) 389 if (isHTMLTextAreaElement(m_innerNonSharedNode.get()))
389 return true; 390 return true;
390 391
391 if (m_innerNonSharedNode->hasTagName(inputTag)) 392 if (m_innerNonSharedNode->hasTagName(inputTag))
392 return toHTMLInputElement(m_innerNonSharedNode.get())->isTextField(); 393 return toHTMLInputElement(m_innerNonSharedNode.get())->isTextField();
393 394
394 return m_innerNonSharedNode->rendererIsEditable(); 395 return m_innerNonSharedNode->rendererIsEditable();
395 } 396 }
396 397
397 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) 398 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect)
398 { 399 {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 { 489 {
489 NodeRenderingTraversal::ParentDetails details; 490 NodeRenderingTraversal::ParentDetails details;
490 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node, &details)) 491 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node, &details))
491 if (node->isElementNode()) 492 if (node->isElementNode())
492 return toElement(node); 493 return toElement(node);
493 494
494 return 0; 495 return 0;
495 } 496 }
496 497
497 } // namespace WebCore 498 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698