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

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

Issue 349313007: Style resolver should not add margins to form control elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove wrong CSS properties Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/multicol/multicol-with-child-renderLayer-for-input-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index d90638251b3b3cc0672c32262b578487480e6f14..e1a344bb897903a367a286239b17a47c4c7ef17e 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -66,28 +66,6 @@ static inline bool isAtShadowBoundary(const Element* element)
}
-static void addIntrinsicMargins(RenderStyle* style)
-{
- // Intrinsic margin value.
- const int intrinsicMargin = 2 * style->effectiveZoom();
-
- // FIXME: Using width/height alone and not also dealing with min-width/max-width is flawed.
- // FIXME: Using "quirk" to decide the margin wasn't set is kind of lame.
- if (style->width().isIntrinsicOrAuto()) {
- if (style->marginLeft().quirk())
- style->setMarginLeft(Length(intrinsicMargin, Fixed));
- if (style->marginRight().quirk())
- style->setMarginRight(Length(intrinsicMargin, Fixed));
- }
-
- if (style->height().isAuto()) {
- if (style->marginTop().quirk())
- style->setMarginTop(Length(intrinsicMargin, Fixed));
- if (style->marginBottom().quirk())
- style->setMarginBottom(Length(intrinsicMargin, Fixed));
- }
-}
-
static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool strictParsing)
{
switch (display) {
@@ -356,20 +334,10 @@ void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* paren
return;
}
- if (element.isFormControlElement()) {
- if (isHTMLTextAreaElement(element)) {
- // Textarea considers overflow visible as auto.
- style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->overflowX());
- style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->overflowY());
- }
-
- // Important: Intrinsic margins get added to controls before the theme has adjusted the style,
- // since the theme will alter fonts and heights/widths.
- //
- // Don't apply intrinsic margins to image buttons. The designer knows how big the images are,
- // so we have to treat all image buttons as though they were explicitly sized.
- if (style->fontSize() >= 11 && (!isHTMLInputElement(element) || !toHTMLInputElement(element).isImageButton()))
- addIntrinsicMargins(style);
+ if (isHTMLTextAreaElement(element)) {
+ // Textarea considers overflow visible as auto.
+ style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->overflowX());
+ style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->overflowY());
return;
}
« no previous file with comments | « LayoutTests/fast/multicol/multicol-with-child-renderLayer-for-input-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698