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

Side by Side Diff: sky/engine/core/editing/TextIterator.cpp

Issue 735193002: Remove lots of things from RenderObject (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/dom/Position.cpp ('k') | sky/engine/core/editing/VisibleUnits.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) 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 // Enter user-agent shadow root, if necessary. 413 // Enter user-agent shadow root, if necessary.
414 if (m_iterationProgress < HandledUserAgentShadowRoot) 414 if (m_iterationProgress < HandledUserAgentShadowRoot)
415 m_iterationProgress = HandledUserAgentShadowRoot; 415 m_iterationProgress = HandledUserAgentShadowRoot;
416 416
417 // Handle the current node according to its type. 417 // Handle the current node according to its type.
418 if (m_iterationProgress < HandledNode) { 418 if (m_iterationProgress < HandledNode) {
419 bool handledNode = false; 419 bool handledNode = false;
420 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) { 420 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) {
421 handledNode = handleTextNode(); 421 handledNode = handleTextNode();
422 } else if (renderer && (renderer->isImage() || renderer->isWidge t())) { 422 } else if (renderer && renderer->isImage()) {
423 handledNode = handleReplacedElement(); 423 handledNode = handleReplacedElement();
424 } else { 424 } else {
425 handledNode = handleNonTextNode(); 425 handledNode = handleNonTextNode();
426 } 426 }
427 if (handledNode) 427 if (handledNode)
428 m_iterationProgress = HandledNode; 428 m_iterationProgress = HandledNode;
429 if (m_positionNode) 429 if (m_positionNode)
430 return; 430 return;
431 } 431 }
432 } 432 }
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 m_positionNode = nullptr; 1031 m_positionNode = nullptr;
1032 m_textLength = 0; 1032 m_textLength = 0;
1033 1033
1034 while (m_node && !m_havePassedStartNode) { 1034 while (m_node && !m_havePassedStartNode) {
1035 // Don't handle node if we start iterating at [node, 0]. 1035 // Don't handle node if we start iterating at [node, 0].
1036 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) { 1036 if (!m_handledNode && !(m_node == m_endNode && !m_endOffset)) {
1037 RenderObject* renderer = m_node->renderer(); 1037 RenderObject* renderer = m_node->renderer();
1038 if (renderer && renderer->isText() && m_node->nodeType() == Node::TE XT_NODE) { 1038 if (renderer && renderer->isText() && m_node->nodeType() == Node::TE XT_NODE) {
1039 if (m_offset > 0) 1039 if (m_offset > 0)
1040 m_handledNode = handleTextNode(); 1040 m_handledNode = handleTextNode();
1041 } else if (renderer && (renderer->isImage() || renderer->isWidget()) ) { 1041 } else if (renderer && renderer->isImage()) {
1042 if (m_offset > 0) 1042 if (m_offset > 0)
1043 m_handledNode = handleReplacedElement(); 1043 m_handledNode = handleReplacedElement();
1044 } else { 1044 } else {
1045 m_handledNode = handleNonTextNode(); 1045 m_handledNode = handleNonTextNode();
1046 } 1046 }
1047 if (m_positionNode) 1047 if (m_positionNode)
1048 return; 1048 return;
1049 } 1049 }
1050 1050
1051 if (!m_handledChildren && m_node->hasChildren()) { 1051 if (!m_handledChildren && m_node->hasChildren()) {
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 resultEnd = collapseTo; 1893 resultEnd = collapseTo;
1894 return; 1894 return;
1895 } 1895 }
1896 } 1896 }
1897 1897
1898 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText); 1898 CharacterIterator computeRangeIterator(inputStart, inputEnd, iteratorFlagsFo rFindPlainText);
1899 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd); 1899 calculateCharacterSubrange(computeRangeIterator, matchStart, matchLength, re sultStart, resultEnd);
1900 } 1900 }
1901 1901
1902 } 1902 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Position.cpp ('k') | sky/engine/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698