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

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

Issue 521603002: Do not use SubtreeStyleChange for reattachment of plugin renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 if (usePlaceholderContent()) 241 if (usePlaceholderContent())
242 return new RenderBlockFlow(this); 242 return new RenderBlockFlow(this);
243 243
244 return new RenderEmbeddedObject(this); 244 return new RenderEmbeddedObject(this);
245 } 245 }
246 246
247 void HTMLPlugInElement::willRecalcStyle(StyleRecalcChange) 247 void HTMLPlugInElement::willRecalcStyle(StyleRecalcChange)
248 { 248 {
249 // FIXME: Why is this necessary? Manual re-attach is almost always wrong. 249 // FIXME: Why is this necessary? Manual re-attach is almost always wrong.
250 //
251 // Attributes like type/classid/data determines the type of the embedded con tent
252 // rendered. If that type changes, the RenderObject needs to be re-attached.
253 // That is triggered by the triggerReattachThroughStyleRecalcHack() method b elow
254 // causing a style recalc, which in turn calls this method, where the render er is
255 // re-attached below.
256 //
257 // There are possibly side-effects of doing that here, and not as part of re -attaching
258 // inside Element::recalcStyle.
259 //
260 // Alternatively, we could call lazyReattachIfAttached() where
261 // triggerReattachThroughStyleRecalcHack() is currently called.
262 //
263 // Doing that currently causes regressions in some tests because
264 // reattachWhitespaceSiblings() will be called after a reattach that is done from
esprehn 2014/09/19 04:15:08 Can we just rebaseline those tests? What did it ac
rune 2014/09/19 11:21:59 We regressed in an paint invalidation test where t
265 // Element::recalcStyle.
266 //
267 // The fact that HTMLObjectElement::updateWidgetInternal (called from a time r) is
268 // responsible for reattaching fallback content, while reattaching embedded content
269 // renderers happens here as part of style recalc also seems sketchy since t hey are
270 // both responses to determining the content type.
271
250 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate() && renderer() && !isImageType()) 272 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate() && renderer() && !isImageType())
251 reattach(); 273 reattach();
252 } 274 }
253 275
276 void HTMLPlugInElement::triggerReattachThroughStyleRecalcHack()
277 {
278 // No styles to recalc, just to trigger a call to willRecalcStyle() :-(
esprehn 2014/09/19 04:15:08 FIXME:
279 setNeedsStyleRecalc(LocalStyleChange);
280 }
281
254 void HTMLPlugInElement::finishParsingChildren() 282 void HTMLPlugInElement::finishParsingChildren()
255 { 283 {
256 HTMLFrameOwnerElement::finishParsingChildren(); 284 HTMLFrameOwnerElement::finishParsingChildren();
257 if (useFallbackContent()) 285 if (useFallbackContent())
258 return; 286 return;
259 287
260 setNeedsWidgetUpdate(true); 288 setNeedsWidgetUpdate(true);
261 if (inDocument()) 289 if (inDocument())
262 setNeedsStyleRecalc(SubtreeStyleChange); 290 triggerReattachThroughStyleRecalcHack();
263 } 291 }
264 292
265 void HTMLPlugInElement::resetInstance() 293 void HTMLPlugInElement::resetInstance()
266 { 294 {
267 m_pluginWrapper.clear(); 295 m_pluginWrapper.clear();
268 } 296 }
269 297
270 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() 298 SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper()
271 { 299 {
272 LocalFrame* frame = document().frame(); 300 LocalFrame* frame = document().frame();
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 614
587 void HTMLPlugInElement::setUsePlaceholderContent(bool use) 615 void HTMLPlugInElement::setUsePlaceholderContent(bool use)
588 { 616 {
589 if (use != m_usePlaceholderContent) { 617 if (use != m_usePlaceholderContent) {
590 m_usePlaceholderContent = use; 618 m_usePlaceholderContent = use;
591 lazyReattachIfAttached(); 619 lazyReattachIfAttached();
592 } 620 }
593 } 621 }
594 622
595 } 623 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698