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 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2828 if (m_rareData) | 2828 if (m_rareData) |
2829 return *m_rareData; | 2829 return *m_rareData; |
2830 | 2830 |
2831 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); | 2831 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); |
2832 return *m_rareData; | 2832 return *m_rareData; |
2833 } | 2833 } |
2834 | 2834 |
2835 void LayoutBlockFlow::positionDialog() | 2835 void LayoutBlockFlow::positionDialog() |
2836 { | 2836 { |
2837 HTMLDialogElement* dialog = toHTMLDialogElement(node()); | 2837 HTMLDialogElement* dialog = toHTMLDialogElement(node()); |
2838 if (dialog->centeringMode() == HTMLDialogElement::NotCentered) | 2838 if (dialog->getCenteringMode() == HTMLDialogElement::NotCentered) |
2839 return; | 2839 return; |
2840 | 2840 |
2841 bool canCenterDialog = (style()->position() == AbsolutePosition || style()->
position() == FixedPosition) | 2841 bool canCenterDialog = (style()->position() == AbsolutePosition || style()->
position() == FixedPosition) |
2842 && style()->hasAutoTopAndBottom(); | 2842 && style()->hasAutoTopAndBottom(); |
2843 | 2843 |
2844 if (dialog->centeringMode() == HTMLDialogElement::Centered) { | 2844 if (dialog->getCenteringMode() == HTMLDialogElement::Centered) { |
2845 if (canCenterDialog) | 2845 if (canCenterDialog) |
2846 setY(dialog->centeredPosition()); | 2846 setY(dialog->centeredPosition()); |
2847 return; | 2847 return; |
2848 } | 2848 } |
2849 | 2849 |
2850 ASSERT(dialog->centeringMode() == HTMLDialogElement::NeedsCentering); | 2850 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering); |
2851 if (!canCenterDialog) { | 2851 if (!canCenterDialog) { |
2852 dialog->setNotCentered(); | 2852 dialog->setNotCentered(); |
2853 return; | 2853 return; |
2854 } | 2854 } |
2855 | 2855 |
2856 FrameView* frameView = document().view(); | 2856 FrameView* frameView = document().view(); |
2857 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) ? 0 : fra
meView->scrollOffset().height()); | 2857 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) ? 0 : fra
meView->scrollOffset().height()); |
2858 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 2858 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
2859 if (size().height() < visibleHeight) | 2859 if (size().height() < visibleHeight) |
2860 top += (visibleHeight - size().height()) / 2; | 2860 top += (visibleHeight - size().height()) / 2; |
2861 setY(top); | 2861 setY(top); |
2862 dialog->setCentered(top); | 2862 dialog->setCentered(top); |
2863 } | 2863 } |
2864 | 2864 |
2865 } // namespace blink | 2865 } // namespace blink |
OLD | NEW |