OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // FIXME: Figure out what to do in vertical writing mode. | 92 // FIXME: Figure out what to do in vertical writing mode. |
93 FrameView* frameView = document()->view(); | 93 FrameView* frameView = document()->view(); |
94 int scrollTop = frameView->scrollOffset().height(); | 94 int scrollTop = frameView->scrollOffset().height(); |
95 int visibleHeight = frameView->visibleContentRect(ScrollableArea::IncludeScr
ollbars).height(); | 95 int visibleHeight = frameView->visibleContentRect(ScrollableArea::IncludeScr
ollbars).height(); |
96 m_top = scrollTop; | 96 m_top = scrollTop; |
97 if (box->height() < visibleHeight) | 97 if (box->height() < visibleHeight) |
98 m_top += (visibleHeight - box->height()) / 2; | 98 m_top += (visibleHeight - box->height()) / 2; |
99 m_topIsValid = true; | 99 m_topIsValid = true; |
100 | 100 |
101 // FIXME: It's inefficient to reattach here. We could do better by mutating
style directly and forcing another layout. | 101 // FIXME: It's inefficient to reattach here. We could do better by mutating
style directly and forcing another layout. |
102 reattach(); | 102 lazyReattach(); |
103 } | 103 } |
104 | 104 |
105 void HTMLDialogElement::show() | 105 void HTMLDialogElement::show() |
106 { | 106 { |
107 if (fastHasAttribute(openAttr)) | 107 if (fastHasAttribute(openAttr)) |
108 return; | 108 return; |
109 setBooleanAttribute(openAttr, true); | 109 setBooleanAttribute(openAttr, true); |
110 positionAndReattach(); | 110 positionAndReattach(); |
111 } | 111 } |
112 | 112 |
(...skipping 19 matching lines...) Expand all Loading... |
132 } | 132 } |
133 | 133 |
134 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty
le) const | 134 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty
le) const |
135 { | 135 { |
136 if (style && style->position() == AbsolutePosition) | 136 if (style && style->position() == AbsolutePosition) |
137 return true; | 137 return true; |
138 return Element::shouldBeReparentedUnderRenderView(style); | 138 return Element::shouldBeReparentedUnderRenderView(style); |
139 } | 139 } |
140 | 140 |
141 } // namespace WebCore | 141 } // namespace WebCore |
OLD | NEW |