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

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

Issue 16336010: Revert 150924 "Node::lazyAttach shouldn't lie about being attached" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 6 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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // FIXME: Figure out what to do in vertical writing mode. 91 // FIXME: Figure out what to do in vertical writing mode.
92 FrameView* frameView = document()->view(); 92 FrameView* frameView = document()->view();
93 int scrollTop = frameView->scrollOffset().height(); 93 int scrollTop = frameView->scrollOffset().height();
94 int visibleHeight = frameView->visibleContentRect(ScrollableArea::IncludeScr ollbars).height(); 94 int visibleHeight = frameView->visibleContentRect(ScrollableArea::IncludeScr ollbars).height();
95 m_top = scrollTop; 95 m_top = scrollTop;
96 if (box->height() < visibleHeight) 96 if (box->height() < visibleHeight)
97 m_top += (visibleHeight - box->height()) / 2; 97 m_top += (visibleHeight - box->height()) / 2;
98 m_topIsValid = true; 98 m_topIsValid = true;
99 99
100 // FIXME: It's inefficient to reattach here. We could do better by mutating style directly and forcing another layout. 100 // FIXME: It's inefficient to reattach here. We could do better by mutating style directly and forcing another layout.
101 lazyReattach(); 101 reattach();
102 } 102 }
103 103
104 void HTMLDialogElement::show() 104 void HTMLDialogElement::show()
105 { 105 {
106 if (fastHasAttribute(openAttr)) 106 if (fastHasAttribute(openAttr))
107 return; 107 return;
108 setBooleanAttribute(openAttr, true); 108 setBooleanAttribute(openAttr, true);
109 positionAndReattach(); 109 positionAndReattach();
110 } 110 }
111 111
(...skipping 19 matching lines...) Expand all
131 } 131 }
132 132
133 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty le) const 133 bool HTMLDialogElement::shouldBeReparentedUnderRenderView(const RenderStyle* sty le) const
134 { 134 {
135 if (style && style->position() == AbsolutePosition) 135 if (style && style->position() == AbsolutePosition)
136 return true; 136 return true;
137 return Element::shouldBeReparentedUnderRenderView(style); 137 return Element::shouldBeReparentedUnderRenderView(style);
138 } 138 }
139 139
140 } // namespace WebCore 140 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/core/dom/shadow/ShadowRoot.cpp ('k') | trunk/Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698