OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2836 IntRect alignSelectionRectToDevicePixels(LayoutRect& rect) | 2836 IntRect alignSelectionRectToDevicePixels(LayoutRect& rect) |
2837 { | 2837 { |
2838 LayoutUnit roundedX = rect.x().round(); | 2838 LayoutUnit roundedX = rect.x().round(); |
2839 return IntRect(roundedX, rect.y().round(), | 2839 return IntRect(roundedX, rect.y().round(), |
2840 (rect.maxX() - roundedX).round(), | 2840 (rect.maxX() - roundedX).round(), |
2841 snapSizeToPixel(rect.height(), rect.y())); | 2841 snapSizeToPixel(rect.height(), rect.y())); |
2842 } | 2842 } |
2843 | 2843 |
2844 bool LayoutBlockFlow::shouldPaintSelectionGaps() const | 2844 bool LayoutBlockFlow::shouldPaintSelectionGaps() const |
2845 { | 2845 { |
2846 return selectionState() != SelectionNone && style()->visibility() == VISIBLE
&& isSelectionRoot(); | 2846 // TODO(chrishtr): remove the feature once we are sure it will be ok to do s
o. See crbug.com/471908 for more details. |
| 2847 return RuntimeEnabledFeatures::selectionGapPaintingEnabled() |
| 2848 && selectionState() != SelectionNone && style()->visibility() == VISIBLE
&& isSelectionRoot(); |
2847 } | 2849 } |
2848 | 2850 |
2849 LayoutRect LayoutBlockFlow::blockSelectionGap(const LayoutBlock* rootBlock, cons
t LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 2851 LayoutRect LayoutBlockFlow::blockSelectionGap(const LayoutBlock* rootBlock, cons
t LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
2850 LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLogica
lRight, LayoutUnit logicalBottom, const PaintInfo* paintInfo) const | 2852 LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLogica
lRight, LayoutUnit logicalBottom, const PaintInfo* paintInfo) const |
2851 { | 2853 { |
2852 LayoutUnit logicalTop = lastLogicalTop; | 2854 LayoutUnit logicalTop = lastLogicalTop; |
2853 LayoutUnit logicalHeight = rootBlock->blockDirectionOffset(offsetFromRootBlo
ck) + logicalBottom - logicalTop; | 2855 LayoutUnit logicalHeight = rootBlock->blockDirectionOffset(offsetFromRootBlo
ck) + logicalBottom - logicalTop; |
2854 if (logicalHeight <= 0) | 2856 if (logicalHeight <= 0) |
2855 return LayoutRect(); | 2857 return LayoutRect(); |
2856 | 2858 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3161 } | 3163 } |
3162 if (isAnonymous()) | 3164 if (isAnonymous()) |
3163 return "LayoutBlockFlow (anonymous)"; | 3165 return "LayoutBlockFlow (anonymous)"; |
3164 if (isRelPositioned()) | 3166 if (isRelPositioned()) |
3165 return "LayoutBlockFlow (relative positioned)"; | 3167 return "LayoutBlockFlow (relative positioned)"; |
3166 return "LayoutBlockFlow"; | 3168 return "LayoutBlockFlow"; |
3167 } | 3169 } |
3168 | 3170 |
3169 | 3171 |
3170 } // namespace blink | 3172 } // namespace blink |
OLD | NEW |