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

Side by Side Diff: Source/core/layout/line/RootInlineBox.cpp

Issue 1303413004: Convert some call sites to use explicit LayoutRect->FloatRect conversion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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) 2003, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 // Now fill in any gaps on the line that occurred between two selected e lements. 311 // Now fill in any gaps on the line that occurred between two selected e lements.
312 LayoutUnit lastLogicalLeft = firstBox->logicalRight(); 312 LayoutUnit lastLogicalLeft = firstBox->logicalRight();
313 bool isPreviousBoxSelected = firstBox->selectionState() != SelectionNone ; 313 bool isPreviousBoxSelected = firstBox->selectionState() != SelectionNone ;
314 for (InlineBox* box = firstBox->nextLeafChild(); box; box = box->nextLea fChild()) { 314 for (InlineBox* box = firstBox->nextLeafChild(); box; box = box->nextLea fChild()) {
315 if (box->selectionState() != SelectionNone) { 315 if (box->selectionState() != SelectionNone) {
316 LayoutRect logicalRect(lastLogicalLeft, selTop, box->logicalLeft () - lastLogicalLeft, selHeight); 316 LayoutRect logicalRect(lastLogicalLeft, selTop, box->logicalLeft () - lastLogicalLeft, selHeight);
317 logicalRect.move(lineLayoutItem().isHorizontalWritingMode() ? of fsetFromRootBlock : LayoutSize(offsetFromRootBlock.height(), offsetFromRootBlock .width())); 317 logicalRect.move(lineLayoutItem().isHorizontalWritingMode() ? of fsetFromRootBlock : LayoutSize(offsetFromRootBlock.height(), offsetFromRootBlock .width()));
318 LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBl ockPhysicalPosition, logicalRect); 318 LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(rootBl ockPhysicalPosition, logicalRect);
319 if (isPreviousBoxSelected && gapRect.width() > 0 && gapRect.heig ht() > 0) { 319 if (isPreviousBoxSelected && gapRect.width() > 0 && gapRect.heig ht() > 0) {
320 if (paintInfo && box->parent()->lineLayoutItem().style()->vi sibility() == VISIBLE) 320 if (paintInfo && box->parent()->lineLayoutItem().style()->vi sibility() == VISIBLE)
321 paintInfo->context->fillRect(gapRect, box->parent()->lin eLayoutItem().selectionBackgroundColor()); 321 paintInfo->context->fillRect(FloatRect(gapRect), box->pa rent()->lineLayoutItem().selectionBackgroundColor());
322 // VisibleSelection may be non-contiguous, see comment above . 322 // VisibleSelection may be non-contiguous, see comment above .
323 result.uniteCenter(gapRect); 323 result.uniteCenter(gapRect);
324 } 324 }
325 lastLogicalLeft = box->logicalRight(); 325 lastLogicalLeft = box->logicalRight();
326 } 326 }
327 if (box == lastBox) 327 if (box == lastBox)
328 break; 328 break;
329 isPreviousBoxSelected = box->selectionState() != SelectionNone; 329 isPreviousBoxSelected = box->selectionState() != SelectionNone;
330 } 330 }
331 } 331 }
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 endBox = nullptr; 848 endBox = nullptr;
849 return nullptr; 849 return nullptr;
850 } 850 }
851 851
852 const char* RootInlineBox::boxName() const 852 const char* RootInlineBox::boxName() const
853 { 853 {
854 return "RootInlineBox"; 854 return "RootInlineBox";
855 } 855 }
856 856
857 } // namespace blink 857 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/line/AbstractInlineTextBox.cpp ('k') | Source/core/layout/svg/LayoutSVGText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698