Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: Source/core/html/HTMLDialogElement.cpp

Issue 15159008: Node::lazyAttach shouldn't lie about being attached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase again Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.cpp ('k') | Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.cpp ('k') | Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698