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

Side by Side Diff: Source/core/rendering/RenderLineBoxList.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/rendering/RenderInline.cpp ('k') | Source/core/rendering/RenderOverflow.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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 void RenderLineBoxList::dirtyLineBoxes() 141 void RenderLineBoxList::dirtyLineBoxes()
142 { 142 {
143 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) 143 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
144 curr->dirtyLineBoxes(); 144 curr->dirtyLineBoxes();
145 } 145 }
146 146
147 bool RenderLineBoxList::rangeIntersectsRect(LayoutBoxModelObject* renderer, Layo utUnit logicalTop, LayoutUnit logicalBottom, const LayoutRect& rect, const Layou tPoint& offset) const 147 bool RenderLineBoxList::rangeIntersectsRect(LayoutBoxModelObject* renderer, Layo utUnit logicalTop, LayoutUnit logicalBottom, const LayoutRect& rect, const Layou tPoint& offset) const
148 { 148 {
149 RenderBox* block; 149 LayoutBox* block;
150 if (renderer->isBox()) 150 if (renderer->isBox())
151 block = toRenderBox(renderer); 151 block = toLayoutBox(renderer);
152 else 152 else
153 block = renderer->containingBlock(); 153 block = renderer->containingBlock();
154 LayoutUnit physicalStart = block->flipForWritingMode(logicalTop); 154 LayoutUnit physicalStart = block->flipForWritingMode(logicalTop);
155 LayoutUnit physicalEnd = block->flipForWritingMode(logicalBottom); 155 LayoutUnit physicalEnd = block->flipForWritingMode(logicalBottom);
156 LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart); 156 LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart);
157 physicalStart = std::min(physicalStart, physicalEnd); 157 physicalStart = std::min(physicalStart, physicalEnd);
158 158
159 if (renderer->style()->isHorizontalWritingMode()) { 159 if (renderer->style()->isHorizontalWritingMode()) {
160 physicalStart += offset.y(); 160 physicalStart += offset.y();
161 if (physicalStart >= rect.maxY() || physicalStart + physicalExtent <= re ct.y()) 161 if (physicalStart >= rect.maxY() || physicalStart + physicalExtent <= re ct.y())
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 LayoutObject* curr = 0; 254 LayoutObject* curr = 0;
255 ListHashSet<LayoutObject*, 16> potentialLineBreakObjects; 255 ListHashSet<LayoutObject*, 16> potentialLineBreakObjects;
256 potentialLineBreakObjects.add(child); 256 potentialLineBreakObjects.add(child);
257 for (curr = child->previousSibling(); curr; curr = curr->previousSibling()) { 257 for (curr = child->previousSibling(); curr; curr = curr->previousSibling()) {
258 potentialLineBreakObjects.add(curr); 258 potentialLineBreakObjects.add(curr);
259 259
260 if (curr->isFloatingOrOutOfFlowPositioned()) 260 if (curr->isFloatingOrOutOfFlowPositioned())
261 continue; 261 continue;
262 262
263 if (curr->isReplaced()) { 263 if (curr->isReplaced()) {
264 InlineBox* wrapper = toRenderBox(curr)->inlineBoxWrapper(); 264 InlineBox* wrapper = toLayoutBox(curr)->inlineBoxWrapper();
265 if (wrapper) 265 if (wrapper)
266 box = &wrapper->root(); 266 box = &wrapper->root();
267 } else if (curr->isText()) { 267 } else if (curr->isText()) {
268 InlineTextBox* textBox = toRenderText(curr)->lastTextBox(); 268 InlineTextBox* textBox = toRenderText(curr)->lastTextBox();
269 if (textBox) 269 if (textBox)
270 box = &textBox->root(); 270 box = &textBox->root();
271 } else if (curr->isRenderInline()) { 271 } else if (curr->isRenderInline()) {
272 InlineBox* lastSiblingBox = toRenderInline(curr)->lastLineBoxIncludi ngCulling(); 272 InlineBox* lastSiblingBox = toRenderInline(curr)->lastLineBoxIncludi ngCulling();
273 if (lastSiblingBox) 273 if (lastSiblingBox)
274 box = &lastSiblingBox->root(); 274 box = &lastSiblingBox->root();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 ASSERT(child->prevLineBox() == prev); 326 ASSERT(child->prevLineBox() == prev);
327 prev = child; 327 prev = child;
328 } 328 }
329 ASSERT(prev == m_lastLineBox); 329 ASSERT(prev == m_lastLineBox);
330 #endif 330 #endif
331 } 331 }
332 332
333 #endif 333 #endif
334 334
335 } 335 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderInline.cpp ('k') | Source/core/rendering/RenderOverflow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698