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

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

Issue 246203004: Fixed unnecessary Paste Popup showing issue when long press on ReadOnly/Disabled elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Refined the Layout test case. Created 6 years, 2 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
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // FIXME: This function needs a better name and may belong in a different class. It's not 364 // 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 365 // 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 366 // function would make more sense in the ContextMenu class, except that WebEleme ntDictionary
367 // hooks into it. Anyway, we should architect this better. 367 // hooks into it. Anyway, we should architect this better.
368 bool HitTestResult::isContentEditable() const 368 bool HitTestResult::isContentEditable() const
369 { 369 {
370 if (!m_innerNonSharedNode) 370 if (!m_innerNonSharedNode)
371 return false; 371 return false;
372 372
373 if (isHTMLTextAreaElement(*m_innerNonSharedNode)) 373 if (isHTMLTextAreaElement(*m_innerNonSharedNode))
374 return true; 374 return !toHTMLFormControlElement(m_innerNonSharedNode)->isDisabledOrRead Only();
Yuta Kitamura 2014/10/16 04:01:23 nit: Since we know m_innerNodeSharedNode is non-nu
AKVT 2014/10/16 17:17:14 Done. Thank you
375 375
376 if (isHTMLInputElement(*m_innerNonSharedNode)) 376 if (isHTMLInputElement(*m_innerNonSharedNode))
377 return toHTMLInputElement(*m_innerNonSharedNode).isTextField(); 377 return !toHTMLFormControlElement(m_innerNonSharedNode)->isDisabledOrRead Only() && toHTMLInputElement(*m_innerNonSharedNode).isTextField();
Yuta Kitamura 2014/10/16 04:01:23 nit: Doing the type cast twice for the same object
AKVT 2014/10/16 17:17:14 Done. Thank you
378 378
379 return m_innerNonSharedNode->hasEditableStyle(); 379 return m_innerNonSharedNode->hasEditableStyle();
380 } 380 }
381 381
382 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect) 382 bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques t& request, const HitTestLocation& locationInContainer, const LayoutRect& rect)
383 { 383 {
384 // If it is not a rect-based hit test, this method has to be no-op. 384 // If it is not a rect-based hit test, this method has to be no-op.
385 // Return false, so the hit test stops. 385 // Return false, so the hit test stops.
386 if (!isRectBasedTest()) 386 if (!isRectBasedTest())
387 return false; 387 return false;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 { 474 {
475 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) { 475 for (Node* node = m_innerNode.get(); node; node = NodeRenderingTraversal::pa rent(node)) {
476 if (node->isElementNode()) 476 if (node->isElementNode())
477 return toElement(node); 477 return toElement(node);
478 } 478 }
479 479
480 return 0; 480 return 0;
481 } 481 }
482 482
483 } // namespace blink 483 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698