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

Side by Side Diff: Source/core/layout/LayoutBlockFlow.cpp

Issue 1261653002: Move SelectionState out of LayoutObject and into Line Layout API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2 legit 5ever 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/layout/LayoutBlockFlowLine.cpp » ('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) 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 27 matching lines...) Expand all
38 #include "core/html/HTMLDialogElement.h" 38 #include "core/html/HTMLDialogElement.h"
39 #include "core/layout/HitTestLocation.h" 39 #include "core/layout/HitTestLocation.h"
40 #include "core/layout/LayoutAnalyzer.h" 40 #include "core/layout/LayoutAnalyzer.h"
41 #include "core/layout/LayoutFlowThread.h" 41 #include "core/layout/LayoutFlowThread.h"
42 #include "core/layout/LayoutMultiColumnFlowThread.h" 42 #include "core/layout/LayoutMultiColumnFlowThread.h"
43 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" 43 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h"
44 #include "core/layout/LayoutPagedFlowThread.h" 44 #include "core/layout/LayoutPagedFlowThread.h"
45 #include "core/layout/LayoutText.h" 45 #include "core/layout/LayoutText.h"
46 #include "core/layout/LayoutView.h" 46 #include "core/layout/LayoutView.h"
47 #include "core/layout/TextAutosizer.h" 47 #include "core/layout/TextAutosizer.h"
48 #include "core/layout/api/SelectionState.h"
48 #include "core/layout/line/LineBreaker.h" 49 #include "core/layout/line/LineBreaker.h"
49 #include "core/layout/line/LineWidth.h" 50 #include "core/layout/line/LineWidth.h"
50 #include "core/layout/shapes/ShapeOutsideInfo.h" 51 #include "core/layout/shapes/ShapeOutsideInfo.h"
51 #include "core/paint/BlockFlowPainter.h" 52 #include "core/paint/BlockFlowPainter.h"
52 #include "core/paint/ClipScope.h" 53 #include "core/paint/ClipScope.h"
53 #include "core/paint/DeprecatedPaintLayer.h" 54 #include "core/paint/DeprecatedPaintLayer.h"
54 #include "core/paint/LayoutObjectDrawingRecorder.h" 55 #include "core/paint/LayoutObjectDrawingRecorder.h"
55 #include "core/paint/PaintInfo.h" 56 #include "core/paint/PaintInfo.h"
56 #include "platform/RuntimeEnabledFeatures.h" 57 #include "platform/RuntimeEnabledFeatures.h"
57 #include "platform/geometry/TransformState.h" 58 #include "platform/geometry/TransformState.h"
(...skipping 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 if (paintInfo) { 2823 if (paintInfo) {
2823 IntRect selectionGapRect = alignSelectionRectToDevicePixels(gapRect); 2824 IntRect selectionGapRect = alignSelectionRectToDevicePixels(gapRect);
2824 paintInfo->context->fillRect(selectionGapRect, selObj->selectionBackgrou ndColor()); 2825 paintInfo->context->fillRect(selectionGapRect, selObj->selectionBackgrou ndColor());
2825 } 2826 }
2826 return gapRect; 2827 return gapRect;
2827 } 2828 }
2828 2829
2829 void LayoutBlockFlow::getSelectionGapInfo(SelectionState state, bool& leftGap, b ool& rightGap) const 2830 void LayoutBlockFlow::getSelectionGapInfo(SelectionState state, bool& leftGap, b ool& rightGap) const
2830 { 2831 {
2831 bool ltr = style()->isLeftToRightDirection(); 2832 bool ltr = style()->isLeftToRightDirection();
2832 leftGap = (state == LayoutObject::SelectionInside) 2833 leftGap = (state == SelectionInside)
2833 || (state == LayoutObject::SelectionEnd && ltr) 2834 || (state == SelectionEnd && ltr)
2834 || (state == LayoutObject::SelectionStart && !ltr); 2835 || (state == SelectionStart && !ltr);
2835 rightGap = (state == LayoutObject::SelectionInside) 2836 rightGap = (state == SelectionInside)
2836 || (state == LayoutObject::SelectionStart && ltr) 2837 || (state == SelectionStart && ltr)
2837 || (state == LayoutObject::SelectionEnd && !ltr); 2838 || (state == SelectionEnd && !ltr);
2838 } 2839 }
2839 2840
2840 void LayoutBlockFlow::setPaginationStrut(LayoutUnit strut) 2841 void LayoutBlockFlow::setPaginationStrut(LayoutUnit strut)
2841 { 2842 {
2842 if (!m_rareData) { 2843 if (!m_rareData) {
2843 if (!strut) 2844 if (!strut)
2844 return; 2845 return;
2845 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); 2846 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this));
2846 } 2847 }
2847 m_rareData->m_paginationStrut = strut; 2848 m_rareData->m_paginationStrut = strut;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 FrameView* frameView = document().view(); 3013 FrameView* frameView = document().view();
3013 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3014 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3014 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3015 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3015 if (size().height() < visibleHeight) 3016 if (size().height() < visibleHeight)
3016 top += (visibleHeight - size().height()) / 2; 3017 top += (visibleHeight - size().height()) / 2;
3017 setY(top); 3018 setY(top);
3018 dialog->setCentered(top); 3019 dialog->setCentered(top);
3019 } 3020 }
3020 3021
3021 } // namespace blink 3022 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/layout/LayoutBlockFlowLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698