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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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
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(FloatRect(gapRect), box->pa rent()->lineLayoutItem().selectionBackgroundColor()); 321 paintInfo->context.fillRect(FloatRect(gapRect), box->par ent()->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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 endBox = nullptr; 754 endBox = nullptr;
755 return nullptr; 755 return nullptr;
756 } 756 }
757 757
758 const char* RootInlineBox::boxName() const 758 const char* RootInlineBox::boxName() const
759 { 759 {
760 return "RootInlineBox"; 760 return "RootInlineBox";
761 } 761 }
762 762
763 } // namespace blink 763 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698