RESOLVED FIXED 60609
Implement CSSPropertyMargin and CSSPropertyPadding in CSSStyleApplyProperty.
https://bugs.webkit.org/show_bug.cgi?id=60609
Summary Implement CSSPropertyMargin and CSSPropertyPadding in CSSStyleApplyProperty.
Luke Macpherson
Reported 2011-05-10 22:20:21 PDT
Implement CSSPropertyMargin and CSSPropertyPadding in CSSStyleApplyProperty.
Attachments
Patch (5.02 KB, patch)
2011-05-10 22:22 PDT, Luke Macpherson
no flags
Luke Macpherson
Comment 1 2011-05-10 22:22:19 PDT
Eric Seidel (no email)
Comment 2 2011-05-10 22:29:45 PDT
Comment on attachment 93072 [details] Patch OK. How does this do the resetPadding stuff? Or does it call each of the reset funtions individually (thus obsoleting the resetPadidng function?)
Luke Macpherson
Comment 3 2011-05-10 23:30:11 PDT
resetMargin is equivalent to setting the top, left, bottom and right margins to RenderStyle::initialMargin() however, resetPadding sets top, left, bottom, right to AUTO, while the individual cases are setting them to FIXED. This smells a lot like a bug in the existing code - in every case I've seen so far initializing the shorthand is exactly equivalent to initializing the individual values.
Eric Seidel (no email)
Comment 4 2011-05-10 23:39:10 PDT
Comment on attachment 93072 [details] Patch Since we're changing behavior, we'll need a test. You can break out the non-behavior change from the behavior chagne if you like. r=me on landing the non-behavior change w/o further review!
Luke Macpherson
Comment 5 2011-05-11 00:16:20 PDT
For reference, http://www.w3.org/TR/CSS21/box.html#propdef-padding says "Initial: see individual properties"
Luke Macpherson
Comment 6 2011-05-11 18:49:25 PDT
(In reply to comment #5) > For reference, http://www.w3.org/TR/CSS21/box.html#propdef-padding says > "Initial: see individual properties" It appears that because of the way these values are used, Length(AUTO) and Length(FIXED) are treated equivalently. for example: int RenderBoxModelObject::paddingLeft(bool) const { int w = 0; Length padding = style()->paddingLeft(); if (padding.isPercent()) w = containingBlock()->availableLogicalWidth(); return padding.calcMinValue(w); } Will return 0 for both. Using AUTO in RenderStyle means that we are depending on the w=0 above for correct behavior. RenderStyle would better reflect the CSS spec by using RenderStyle::initialPadding() for its initial value. FYI, this is passing DRT and pixel tests for me, and I count 949 uses of "padding:" under LayoutTests/fast, so we already have good coverage there.
Eric Seidel (no email)
Comment 7 2011-05-11 19:45:54 PDT
Can we detect this change with getComputedStyle?
Luke Macpherson
Comment 8 2011-05-11 20:46:21 PDT
(In reply to comment #7) > Can we detect this change with getComputedStyle? I just tested setting "padding: 0px;", "padding: auto;", "padding: 10%". In all cases getComputedStyle(e).getPropertyValue("padding-left") returns a px value; in the first two cases is 0px. I think that means this change is not detectable from JS because it always returns the calculated pixel value.
Eric Seidel (no email)
Comment 9 2011-05-11 20:48:40 PDT
Comment on attachment 93072 [details] Patch Ok. It's possible it might still be reachable from CSSStyleDeclaration. getPropertyCSSValue() somehow, but that's even more obscure. Sounds fine.
WebKit Commit Bot
Comment 10 2011-05-11 22:13:39 PDT
Comment on attachment 93072 [details] Patch Clearing flags on attachment: 93072 Committed r86308: <http://trac.webkit.org/changeset/86308>
WebKit Commit Bot
Comment 11 2011-05-11 22:13:44 PDT
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 12 2011-05-11 23:59:59 PDT
http://trac.webkit.org/changeset/86308 might have broken Windows XP Debug (Tests) The following tests are not passing: editing/deleting/delete-ligature-001.html editing/deleting/delete-ligature-002.html editing/deleting/delete-ligature-003.html
Note You need to log in before you can comment on or make changes to this bug.