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

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

Issue 1319863006: (blink) Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments from Alex Created 5 years, 3 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) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return; 102 return;
103 } 103 }
104 widgetNewParentMap().set(child, parent); 104 widgetNewParentMap().set(child, parent);
105 } 105 }
106 106
107 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum ent& document) 107 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum ent& document)
108 : HTMLElement(tagName, document) 108 : HTMLElement(tagName, document)
109 , m_contentFrame(nullptr) 109 , m_contentFrame(nullptr)
110 , m_widget(nullptr) 110 , m_widget(nullptr)
111 , m_sandboxFlags(SandboxNone) 111 , m_sandboxFlags(SandboxNone)
112 , m_scrollingMode(ScrollbarAuto)
113 , m_marginWidth(-1)
114 , m_marginHeight(-1)
112 { 115 {
113 } 116 }
114 117
115 LayoutPart* HTMLFrameOwnerElement::layoutPart() const 118 LayoutPart* HTMLFrameOwnerElement::layoutPart() const
116 { 119 {
117 // HTMLObjectElement and HTMLEmbedElement may return arbitrary layoutObjects 120 // HTMLObjectElement and HTMLEmbedElement may return arbitrary layoutObjects
118 // when using fallback content. 121 // when using fallback content.
119 if (!layoutObject() || !layoutObject()->isLayoutPart()) 122 if (!layoutObject() || !layoutObject()->isLayoutPart())
120 return nullptr; 123 return nullptr;
121 return toLayoutPart(layoutObject()); 124 return toLayoutPart(layoutObject());
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 187
185 void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags) 188 void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags)
186 { 189 {
187 m_sandboxFlags = flags; 190 m_sandboxFlags = flags;
188 // Don't notify about updates if contentFrame() is null, for example when 191 // Don't notify about updates if contentFrame() is null, for example when
189 // the subframe hasn't been created yet. 192 // the subframe hasn't been created yet.
190 if (contentFrame()) 193 if (contentFrame())
191 document().frame()->loader().client()->didChangeSandboxFlags(contentFram e(), flags); 194 document().frame()->loader().client()->didChangeSandboxFlags(contentFram e(), flags);
192 } 195 }
193 196
197 void HTMLFrameOwnerElement::setScrollingMode(ScrollbarMode scrollbarMode)
198 {
199 m_scrollingMode = scrollbarMode;
200 if (isPluginElement())
201 return;
202 // Don't notify about updates if contentFrame() is null, for example when
203 // the subframe hasn't been created yet.
204 if (contentFrame())
205 document().frame()->loader().client()->didChangeScrollingMode(contentFra me(), scrollbarMode);
alexmos 2015/09/16 00:36:47 You're using three separate IPCs to propagate thes
lazyboy 2015/09/17 20:48:39 I've made renderer->browser one IPC too, with the
alexmos 2015/09/21 16:58:07 Is there a way to avoid storing them on RenderFram
lazyboy 2015/09/21 18:04:51 changed all functions to one: didChangeFrameOwnerP
206 }
207
208 void HTMLFrameOwnerElement::setMarginWidth(int marginWidth)
209 {
210 m_marginWidth = marginWidth;
211 if (isPluginElement())
212 return;
213 // Don't notify about updates if contentFrame() is null, for example when
214 // the subframe hasn't been created yet.
215 if (contentFrame())
216 document().frame()->loader().client()->didChangeMarginWidth(contentFrame (), m_marginWidth);
217 }
218
219 void HTMLFrameOwnerElement::setMarginHeight(int marginHeight)
220 {
221 m_marginHeight = marginHeight;
222 if (isPluginElement())
223 return;
224 // Don't notify about updates if contentFrame() is null, for example when
225 // the subframe hasn't been created yet.
226 if (contentFrame())
227 document().frame()->loader().client()->didChangeMarginHeight(contentFram e(), m_marginHeight);
228 }
229
194 bool HTMLFrameOwnerElement::isKeyboardFocusable() const 230 bool HTMLFrameOwnerElement::isKeyboardFocusable() const
195 { 231 {
196 return m_contentFrame && HTMLElement::isKeyboardFocusable(); 232 return m_contentFrame && HTMLElement::isKeyboardFocusable();
197 } 233 }
198 234
199 void HTMLFrameOwnerElement::dispatchLoad() 235 void HTMLFrameOwnerElement::dispatchLoad()
200 { 236 {
201 dispatchEvent(Event::create(EventTypeNames::load)); 237 dispatchEvent(Event::create(EventTypeNames::load));
202 } 238 }
203 239
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 DEFINE_TRACE(HTMLFrameOwnerElement) 312 DEFINE_TRACE(HTMLFrameOwnerElement)
277 { 313 {
278 visitor->trace(m_contentFrame); 314 visitor->trace(m_contentFrame);
279 visitor->trace(m_widget); 315 visitor->trace(m_widget);
280 HTMLElement::trace(visitor); 316 HTMLElement::trace(visitor);
281 FrameOwner::trace(visitor); 317 FrameOwner::trace(visitor);
282 } 318 }
283 319
284 320
285 } // namespace blink 321 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698