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

Side by Side Diff: Source/core/editing/iterators/TextIterator.cpp

Issue 1209263003: Find in Page should not consider transparent texts. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
3 * Copyright (C) 2005 Alexey Proskuryakov. 3 * Copyright (C) 2005 Alexey Proskuryakov.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 int end = (textNode == m_endContainer) ? m_endOffset : INT_MAX; 443 int end = (textNode == m_endContainer) ? m_endOffset : INT_MAX;
444 int runEnd = std::min(strLength, end); 444 int runEnd = std::min(strLength, end);
445 445
446 if (runStart >= runEnd) 446 if (runStart >= runEnd)
447 return true; 447 return true;
448 448
449 emitText(textNode, textNode->layoutObject(), runStart, runEnd); 449 emitText(textNode, textNode->layoutObject(), runStart, runEnd);
450 return true; 450 return true;
451 } 451 }
452 452
453 if (layoutObject->style()->visitedDependentColor(CSSPropertyColor) == Color: :transparent)
454 return false;
455
453 if (layoutObject->firstTextBox()) 456 if (layoutObject->firstTextBox())
454 m_textBox = layoutObject->firstTextBox(); 457 m_textBox = layoutObject->firstTextBox();
455 458
456 bool shouldHandleFirstLetter = !m_handledFirstLetter && layoutObject->isText Fragment() && !m_offset; 459 bool shouldHandleFirstLetter = !m_handledFirstLetter && layoutObject->isText Fragment() && !m_offset;
457 if (shouldHandleFirstLetter) 460 if (shouldHandleFirstLetter)
458 handleTextNodeFirstLetter(toLayoutTextFragment(layoutObject)); 461 handleTextNodeFirstLetter(toLayoutTextFragment(layoutObject));
459 462
460 if (!layoutObject->firstTextBox() && str.length() > 0 && !shouldHandleFirstL etter) { 463 if (!layoutObject->firstTextBox() && str.length() > 0 && !shouldHandleFirstL etter) {
461 if (layoutObject->style()->visibility() != VISIBLE && !ignoresStyleVisib ility()) 464 if (layoutObject->style()->visibility() != VISIBLE && !ignoresStyleVisib ility())
462 return false; 465 return false;
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 1104
1102 String plainText(const PositionInComposedTree& start, const PositionInComposedTr ee& end, TextIteratorBehaviorFlags behavior) 1105 String plainText(const PositionInComposedTree& start, const PositionInComposedTr ee& end, TextIteratorBehaviorFlags behavior)
1103 { 1106 {
1104 return createPlainText<EditingInComposedTreeStrategy>(start, end, behavior); 1107 return createPlainText<EditingInComposedTreeStrategy>(start, end, behavior);
1105 } 1108 }
1106 1109
1107 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>; 1110 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingStrategy>;
1108 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS trategy>; 1111 template class CORE_TEMPLATE_EXPORT TextIteratorAlgorithm<EditingInComposedTreeS trategy>;
1109 1112
1110 } // namespace blink 1113 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698