| 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 27 matching lines...) Expand all Loading... |
| 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 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2859 if (paintInfo) { | 2860 if (paintInfo) { |
| 2860 IntRect selectionGapRect = alignSelectionRectToDevicePixels(gapRect); | 2861 IntRect selectionGapRect = alignSelectionRectToDevicePixels(gapRect); |
| 2861 paintInfo->context->fillRect(selectionGapRect, selObj->selectionBackgrou
ndColor()); | 2862 paintInfo->context->fillRect(selectionGapRect, selObj->selectionBackgrou
ndColor()); |
| 2862 } | 2863 } |
| 2863 return gapRect; | 2864 return gapRect; |
| 2864 } | 2865 } |
| 2865 | 2866 |
| 2866 void LayoutBlockFlow::getSelectionGapInfo(SelectionState state, bool& leftGap, b
ool& rightGap) const | 2867 void LayoutBlockFlow::getSelectionGapInfo(SelectionState state, bool& leftGap, b
ool& rightGap) const |
| 2867 { | 2868 { |
| 2868 bool ltr = style()->isLeftToRightDirection(); | 2869 bool ltr = style()->isLeftToRightDirection(); |
| 2869 leftGap = (state == LayoutObject::SelectionInside) | 2870 leftGap = (state == SelectionInside) |
| 2870 || (state == LayoutObject::SelectionEnd && ltr) | 2871 || (state == SelectionEnd && ltr) |
| 2871 || (state == LayoutObject::SelectionStart && !ltr); | 2872 || (state == SelectionStart && !ltr); |
| 2872 rightGap = (state == LayoutObject::SelectionInside) | 2873 rightGap = (state == SelectionInside) |
| 2873 || (state == LayoutObject::SelectionStart && ltr) | 2874 || (state == SelectionStart && ltr) |
| 2874 || (state == LayoutObject::SelectionEnd && !ltr); | 2875 || (state == SelectionEnd && !ltr); |
| 2875 } | 2876 } |
| 2876 | 2877 |
| 2877 void LayoutBlockFlow::setPaginationStrut(LayoutUnit strut) | 2878 void LayoutBlockFlow::setPaginationStrut(LayoutUnit strut) |
| 2878 { | 2879 { |
| 2879 if (!m_rareData) { | 2880 if (!m_rareData) { |
| 2880 if (!strut) | 2881 if (!strut) |
| 2881 return; | 2882 return; |
| 2882 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); | 2883 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); |
| 2883 } | 2884 } |
| 2884 m_rareData->m_paginationStrut = strut; | 2885 m_rareData->m_paginationStrut = strut; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3049 FrameView* frameView = document().view(); | 3050 FrameView* frameView = document().view(); |
| 3050 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3051 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
| 3051 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3052 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
| 3052 if (size().height() < visibleHeight) | 3053 if (size().height() < visibleHeight) |
| 3053 top += (visibleHeight - size().height()) / 2; | 3054 top += (visibleHeight - size().height()) / 2; |
| 3054 setY(top); | 3055 setY(top); |
| 3055 dialog->setCentered(top); | 3056 dialog->setCentered(top); |
| 3056 } | 3057 } |
| 3057 | 3058 |
| 3058 } // namespace blink | 3059 } // namespace blink |
| OLD | NEW |