Bug 70250 - Web Inspector: Margin should be correctly displayed for block-level elements with over-constrained widths.
Summary: Web Inspector: Margin should be correctly displayed for block-level elements ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-10-17 11:21 PDT by Vsevolod Vlasov
Modified: 2016-12-13 15:33 PST (History)
11 users (show)

See Also:


Attachments
example of the error (100 bytes, text/html)
2011-10-17 11:22 PDT, Vsevolod Vlasov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 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.
Comment 1 Vsevolod Vlasov 2011-10-17 11:22:16 PDT
Created attachment 111287 [details]
example of the error
Comment 2 Joseph Pecoraro 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.
Comment 3 Vsevolod Vlasov 2011-10-17 11:45:29 PDT
This could just be called block probably.
Comment 4 Joseph Pecoraro 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.
Comment 5 Vsevolod Vlasov 2011-10-17 14:17:52 PDT
Great. We should have correct values in Metrics pane and Computed Style section then. Renaming the bug.
Comment 6 Radar WebKit Bug Importer 2014-12-17 11:22:37 PST
<rdar://problem/19281516>
Comment 7 Radar WebKit Bug Importer 2014-12-17 11:27:01 PST
<rdar://problem/19281650>