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 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3093 } | 3093 } |
3094 | 3094 |
3095 if (type == NoFlowThread || multiColumnFlowThread()) | 3095 if (type == NoFlowThread || multiColumnFlowThread()) |
3096 return; | 3096 return; |
3097 | 3097 |
3098 // Ruby elements manage child insertion in a special way, and would mess up
insertion of the | 3098 // Ruby elements manage child insertion in a special way, and would mess up
insertion of the |
3099 // flow thread. The flow thread needs to be a direct child of the multicol b
lock (|this|). | 3099 // flow thread. The flow thread needs to be a direct child of the multicol b
lock (|this|). |
3100 if (isRuby()) | 3100 if (isRuby()) |
3101 return; | 3101 return; |
3102 | 3102 |
| 3103 // Fieldsets look for a legend special child (layoutSpecialExcludedChild()).
We currently only |
| 3104 // support one special child per layout object, and the flow thread would ma
ke for a second one. |
| 3105 if (isFieldset()) |
| 3106 return; |
| 3107 |
| 3108 // Form controls are replaced content, and are therefore not supposed to sup
port multicol. |
| 3109 if (isFileUploadControl() || isTextControl() || isListBox()) |
| 3110 return; |
| 3111 |
3103 LayoutMultiColumnFlowThread* flowThread = createMultiColumnFlowThread(type); | 3112 LayoutMultiColumnFlowThread* flowThread = createMultiColumnFlowThread(type); |
3104 addChild(flowThread); | 3113 addChild(flowThread); |
3105 | 3114 |
3106 // Check that addChild() put the flow thread as a direct child, and didn't d
o fancy things. | 3115 // Check that addChild() put the flow thread as a direct child, and didn't d
o fancy things. |
3107 ASSERT(flowThread->parent() == this); | 3116 ASSERT(flowThread->parent() == this); |
3108 | 3117 |
3109 flowThread->populate(); | 3118 flowThread->populate(); |
3110 LayoutBlockFlowRareData& rareData = ensureRareData(); | 3119 LayoutBlockFlowRareData& rareData = ensureRareData(); |
3111 ASSERT(!rareData.m_multiColumnFlowThread); | 3120 ASSERT(!rareData.m_multiColumnFlowThread); |
3112 rareData.m_multiColumnFlowThread = flowThread; | 3121 rareData.m_multiColumnFlowThread = flowThread; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3145 FrameView* frameView = document().view(); | 3154 FrameView* frameView = document().view(); |
3146 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3155 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
3147 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3156 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
3148 if (size().height() < visibleHeight) | 3157 if (size().height() < visibleHeight) |
3149 top += (visibleHeight - size().height()) / 2; | 3158 top += (visibleHeight - size().height()) / 2; |
3150 setY(top); | 3159 setY(top); |
3151 dialog->setCentered(top); | 3160 dialog->setCentered(top); |
3152 } | 3161 } |
3153 | 3162 |
3154 } // namespace blink | 3163 } // namespace blink |
OLD | NEW |