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

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

Issue 625073002: Merge RenderWidget into single subclass, RenderPart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: s/widget/part wherever it made sense 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 | Annotate | Revision Log
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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 continue; 458 continue;
459 } 459 }
460 m_iterationProgress = HandledUserAgentShadowRoot; 460 m_iterationProgress = HandledUserAgentShadowRoot;
461 } 461 }
462 462
463 // Handle the current node according to its type. 463 // Handle the current node according to its type.
464 if (m_iterationProgress < HandledNode) { 464 if (m_iterationProgress < HandledNode) {
465 bool handledNode = false; 465 bool handledNode = false;
466 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) { // FIXME: What about CDATA_SECTION_NODE? 466 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) { // FIXME: What about CDATA_SECTION_NODE?
467 handledNode = handleTextNode(); 467 handledNode = handleTextNode();
468 } else if (renderer && (renderer->isImage() || renderer->isWidge t() 468 } else if (renderer && (renderer->isImage() || renderer->isRende rPart()
469 || (m_node && m_node->isHTMLElement() 469 || (m_node && m_node->isHTMLElement()
470 && (isHTMLFormControlElement(toHTMLElement(*m_node)) 470 && (isHTMLFormControlElement(toHTMLElement(*m_node))
471 || isHTMLLegendElement(toHTMLElement(*m_node)) 471 || isHTMLLegendElement(toHTMLElement(*m_node))
472 || isHTMLMeterElement(toHTMLElement(*m_node)) 472 || isHTMLMeterElement(toHTMLElement(*m_node))
473 || isHTMLProgressElement(toHTMLElement(*m_node)))))) { 473 || isHTMLProgressElement(toHTMLElement(*m_node)))))) {
474 handledNode = handleReplacedElement(); 474 handledNode = handleReplacedElement();
475 } else { 475 } else {
476 handledNode = handleNonTextNode(); 476 handledNode = handleNonTextNode();
477 } 477 }
478 if (handledNode) 478 if (handledNode)
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 m_textLength = 0; 1402 m_textLength = 0;
1403 1403
1404 while (m_node && !m_havePassedStartNode) { 1404 while (m_node && !m_havePassedStartNode) {
1405 // Don't handle node if we start iterating at [node, 0]. 1405 // Don't handle node if we start iterating at [node, 0].
1406 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) { 1406 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) {
1407 RenderObject* renderer = m_node->renderer(); 1407 RenderObject* renderer = m_node->renderer();
1408 if (renderer && renderer->isText() && m_node->nodeType() == Node::TE XT_NODE) { 1408 if (renderer && renderer->isText() && m_node->nodeType() == Node::TE XT_NODE) {
1409 // FIXME: What about CDATA_SECTION_NODE? 1409 // FIXME: What about CDATA_SECTION_NODE?
1410 if (renderer->style()->visibility() == VISIBLE && m_offset > 0) 1410 if (renderer->style()->visibility() == VISIBLE && m_offset > 0)
1411 m_handledNode = handleTextNode(); 1411 m_handledNode = handleTextNode();
1412 } else if (renderer && (renderer->isImage() || renderer->isWidget()) ) { 1412 } else if (renderer && (renderer->isImage() || renderer->isRenderPar t())) {
1413 if (renderer->style()->visibility() == VISIBLE && m_offset > 0) 1413 if (renderer->style()->visibility() == VISIBLE && m_offset > 0)
1414 m_handledNode = handleReplacedElement(); 1414 m_handledNode = handleReplacedElement();
1415 } else { 1415 } else {
1416 m_handledNode = handleNonTextNode(); 1416 m_handledNode = handleNonTextNode();
1417 } 1417 }
1418 if (m_positionNode) 1418 if (m_positionNode)
1419 return; 1419 return;
1420 } 1420 }
1421 1421
1422 if (!m_handledChildren && m_node->hasChildren()) { 1422 if (!m_handledChildren && m_node->hasChildren()) {
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 resultEnd = collapseTo; 2421 resultEnd = collapseTo;
2422 return; 2422 return;
2423 } 2423 }
2424 } 2424 }
2425 2425
2426 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText); 2426 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText);
2427 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd); 2427 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd);
2428 } 2428 }
2429 2429
2430 } 2430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698