| 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 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |