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

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

Issue 1203613003: Make inSameLine() in VisibleUnits.cpp to work with positions in composed tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-24T17:52:54 Get rid of redundant explict in RenderedPosition 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 | « Source/core/editing/RenderedPosition.h ('k') | Source/core/editing/VisiblePosition.h » ('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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 { 90 {
91 if (position.isNull()) 91 if (position.isNull())
92 return; 92 return;
93 position.getInlineBoxAndOffset(affinity, m_inlineBox, m_offset); 93 position.getInlineBoxAndOffset(affinity, m_inlineBox, m_offset);
94 if (m_inlineBox) 94 if (m_inlineBox)
95 m_layoutObject = &m_inlineBox->layoutObject(); 95 m_layoutObject = &m_inlineBox->layoutObject();
96 else 96 else
97 m_layoutObject = layoutObjectFromPosition(position); 97 m_layoutObject = layoutObjectFromPosition(position);
98 } 98 }
99 99
100 RenderedPosition::RenderedPosition(const PositionInComposedTree& position, EAffi nity affinity)
101 : RenderedPosition(toPositionInDOMTree(position), affinity)
102 {
103 }
104
100 InlineBox* RenderedPosition::prevLeafChild() const 105 InlineBox* RenderedPosition::prevLeafChild() const
101 { 106 {
102 if (m_prevLeafChild == uncachedInlineBox()) 107 if (m_prevLeafChild == uncachedInlineBox())
103 m_prevLeafChild = m_inlineBox->prevLeafChildIgnoringLineBreak(); 108 m_prevLeafChild = m_inlineBox->prevLeafChildIgnoringLineBreak();
104 return m_prevLeafChild; 109 return m_prevLeafChild;
105 } 110 }
106 111
107 InlineBox* RenderedPosition::nextLeafChild() const 112 InlineBox* RenderedPosition::nextLeafChild() const
108 { 113 {
109 if (m_nextLeafChild == uncachedInlineBox()) 114 if (m_nextLeafChild == uncachedInlineBox())
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 bool layoutObjectContainsPosition(LayoutObject* target, const Position& position ) 256 bool layoutObjectContainsPosition(LayoutObject* target, const Position& position )
252 { 257 {
253 for (LayoutObject* layoutObject = layoutObjectFromPosition(position); layout Object && layoutObject->node(); layoutObject = layoutObject->parent()) { 258 for (LayoutObject* layoutObject = layoutObjectFromPosition(position); layout Object && layoutObject->node(); layoutObject = layoutObject->parent()) {
254 if (layoutObject == target) 259 if (layoutObject == target)
255 return true; 260 return true;
256 } 261 }
257 return false; 262 return false;
258 } 263 }
259 264
260 }; 265 };
OLDNEW
« no previous file with comments | « Source/core/editing/RenderedPosition.h ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698