NEW 70250
Web Inspector: Margin should be correctly displayed for block-level elements with over-constrained widths.
https://bugs.webkit.org/show_bug.cgi?id=70250
Summary Web Inspector: Margin should be correctly displayed for block-level elements ...
Vsevolod Vlasov
Reported 2011-10-17 11:21:34 PDT
Element highlighting shows non existing margin for divs with limited width. To reproduce inspect red square in the example attached.
Attachments
example of the error (100 bytes, text/html)
2011-10-17 11:22 PDT, Vsevolod Vlasov
no flags
Vsevolod Vlasov
Comment 1 2011-10-17 11:22:16 PDT
Created attachment 111287 [details] example of the error
Joseph Pecoraro
Comment 2 2011-10-17 11:40:31 PDT
Yah, I was confused by this the other day. The issue is that, as a display:block, the rest of the line is is displayed with the "margin" color but it isn't really a margin. I don't know the technical term for this region.
Vsevolod Vlasov
Comment 3 2011-10-17 11:45:29 PDT
This could just be called block probably.
Joseph Pecoraro
Comment 4 2011-10-17 12:02:06 PDT
Antti just pointed me to: http://www.w3.org/TR/CSS21/visudet.html#blockwidth > The following constraints must hold among the used values of the other properties: > > 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block > > If 'width' is not 'auto' and 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' > (plus any of 'margin-left' or 'margin-right' that are not 'auto') is larger than the width of the containing block, > then any 'auto' values for 'margin-left' or 'margin-right' are, for the following rules, treated as zero. > > If all of the above have a computed value other than 'auto', the values are said to be "over-constrained" and one of > the used values will have to be different from its computed value. If the 'direction' property of the containing block > has the value 'ltr', the specified value of 'margin-right' is ignored and the value is calculated so as to make the > equality true. If the value of 'direction' is 'rtl', this happens to 'margin-left' instead. Seems like in this case that really is the margin.
Vsevolod Vlasov
Comment 5 2011-10-17 14:17:52 PDT
Great. We should have correct values in Metrics pane and Computed Style section then. Renaming the bug.
Radar WebKit Bug Importer
Comment 6 2014-12-17 11:22:37 PST
Radar WebKit Bug Importer
Comment 7 2014-12-17 11:27:01 PST
Note You need to log in before you can comment on or make changes to this bug.