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

Unified Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 369893006: Allow HTMLPlugInElement to host UA shadow DOM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index 6225ed6d32fcef01ac00058f5eeaf32fbecc80a4..01b0857a3e2e95ba27a5e8c6f42dbe2f07299594 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -42,6 +42,7 @@
#include "core/html/HTMLTextAreaElement.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
+#include "core/rendering/RenderReplaced.h"
#include "core/rendering/RenderTheme.h"
#include "core/rendering/style/GridPosition.h"
#include "core/rendering/style/RenderStyle.h"
@@ -383,6 +384,16 @@ void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* paren
if (isHTMLPlugInElement(element)) {
style->setRequiresAcceleratedCompositingForExternalReasons(toHTMLPlugInElement(element).shouldAccelerate());
+
+ // Plugins should get the standard replaced width/height instead of 'auto'.
+ // Replaced renderers get this for free, and fallback content doesn't count.
+ if (toHTMLPlugInElement(element).usePlaceholderContent()) {
+ if (style->width().isAuto())
+ style->setWidth(Length(RenderReplaced::defaultWidth, Fixed));
+ if (style->height().isAuto())
+ style->setHeight(Length(RenderReplaced::defaultHeight, Fixed));
+ }
+
return;
}
}
« no previous file with comments | « LayoutTests/fast/plugins/plugin-placeholder-explicit-size-expected.html ('k') | Source/core/html/HTMLAppletElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698