OLD | NEW |
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 RenderedPosition::RenderedPosition(const VisiblePosition& position) | 68 RenderedPosition::RenderedPosition(const VisiblePosition& position) |
69 : m_layoutObject(nullptr) | 69 : m_layoutObject(nullptr) |
70 , m_inlineBox(nullptr) | 70 , m_inlineBox(nullptr) |
71 , m_offset(0) | 71 , m_offset(0) |
72 , m_prevLeafChild(uncachedInlineBox()) | 72 , m_prevLeafChild(uncachedInlineBox()) |
73 , m_nextLeafChild(uncachedInlineBox()) | 73 , m_nextLeafChild(uncachedInlineBox()) |
74 { | 74 { |
75 if (position.isNull()) | 75 if (position.isNull()) |
76 return; | 76 return; |
77 InlineBoxPosition boxPosition = position.computeInlineBoxPosition(); | 77 InlineBoxPosition boxPosition = computeInlineBoxPosition(position); |
78 m_inlineBox = boxPosition.inlineBox; | 78 m_inlineBox = boxPosition.inlineBox; |
79 m_offset = boxPosition.offsetInBox; | 79 m_offset = boxPosition.offsetInBox; |
80 if (m_inlineBox) | 80 if (m_inlineBox) |
81 m_layoutObject = &m_inlineBox->layoutObject(); | 81 m_layoutObject = &m_inlineBox->layoutObject(); |
82 else | 82 else |
83 m_layoutObject = layoutObjectFromPosition(position.deepEquivalent()); | 83 m_layoutObject = layoutObjectFromPosition(position.deepEquivalent()); |
84 } | 84 } |
85 | 85 |
86 RenderedPosition::RenderedPosition(const Position& position, EAffinity affinity) | 86 RenderedPosition::RenderedPosition(const Position& position, EAffinity affinity) |
87 : m_layoutObject(nullptr) | 87 : m_layoutObject(nullptr) |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 bool layoutObjectContainsPosition(LayoutObject* target, const Position& position
) | 260 bool layoutObjectContainsPosition(LayoutObject* target, const Position& position
) |
261 { | 261 { |
262 for (LayoutObject* layoutObject = layoutObjectFromPosition(position); layout
Object && layoutObject->node(); layoutObject = layoutObject->parent()) { | 262 for (LayoutObject* layoutObject = layoutObjectFromPosition(position); layout
Object && layoutObject->node(); layoutObject = layoutObject->parent()) { |
263 if (layoutObject == target) | 263 if (layoutObject == target) |
264 return true; | 264 return true; |
265 } | 265 } |
266 return false; | 266 return false; |
267 } | 267 } |
268 | 268 |
269 }; | 269 }; |
OLD | NEW |