Skip to content

Commit 7c88918

Browse files
committed
[css-logical-props] Explain logical box model properties in a little more detail, and give them a proper toplevel section heading.
This adds an explanation of how logical and physical properties cascade together. It also adds an additional open issue about whether getComputedStyle() should accept logical properties. (In Gecko's current implementation, I believe it does not do so, since it seemed easier to add later if we want to add it than to remove later if we don't.) This also makes the logical properties have their own toplevel section rather than being a subsection of the logical page classifications, which seems like it was a mistake. I'm just committing this per https://log.csswg.org/irc.w3.org/css/2015-07-21/#e573158
1 parent 452689a commit 7c88918

2 files changed

Lines changed: 280 additions & 100 deletions

File tree

css-logical-props/Overview.bs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,66 @@ Logical Page Classifications</h2>
131131
The logical page selectors have specificity equal to the ':left'
132132
and ':right' page selectors.
133133

134+
<h2 id="logical-box-props">
135+
Logical Box Model Properties
136+
</h2>
137+
138+
This specification introduces new CSS properties
139+
that are logical equivalents
140+
of physical box model properties.
141+
142+
The specified values of these properties are separate from
143+
the specified values of the parallel physical properties,
144+
but the logical and physical properties share computed values.
145+
Which pairs of properties share computed values
146+
depends on the computed values of
147+
'writing-mode', 'text-orientation', and 'direction'.
148+
For a summary of these dependencies, see
149+
<a href="https://drafts.csswg.org/css-writing-modes/#logical-to-physical">Abstract-to-Physical Mappings</a>
150+
in [[!CSS3-WRITING-MODES]].
151+
152+
A computed value that has logical and physical properties
153+
is determined by applying the CSS cascade to declarations of both.
154+
Overriding is not determined by whether a declaration is logical or physical,
155+
but only by the rules of the CSS cascade [[!CSS3-CASCADE]].
156+
157+
<p class="note">
158+
Note that this requires implementations to maintain
159+
relative order of declarations within a CSS declaration block,
160+
which was not previously required for CSS cascading.
161+
</p>
162+
163+
<div class="example">
164+
For example, given the following rule:
165+
166+
<pre class="lang-css">
167+
p {
168+
margin-inline-start: 1px;
169+
margin-left: 2px;
170+
margin-inline-end: 3px;
171+
}
172+
</pre>
173+
174+
In a paragraph with computed 'writing-mode' being ''horizontal-tb''
175+
and computed 'direction' being ''ltr'',
176+
the computed value of 'margin-left' is ''2px'',
177+
since for that 'writing-mode' and 'direction',
178+
'margin-inline-start' and 'margin-left' share a computed value,
179+
and the declaration of 'margin-left'
180+
is after the declaration of 'margin-inline-start'.
181+
However, if the computed 'direction' were instead ''rtl'',
182+
the computed value of 'margin-left' is ''3px'',
183+
since 'margin-inline-end' and 'margin-left' share a computed value,
184+
and the declaration of 'margin-inline-end'
185+
is after the declaration of 'margin-left'.
186+
</div>
187+
188+
<p class="issue">
189+
How do computed value APIs, e.g., getComputedStyle() work?
190+
Can they be used with either logical or physical properties,
191+
or only with the physical ones?
192+
</p>
193+
134194
<h3 id="logical-dimension-properties">
135195
Logical Height and Logical Width: the 'block-size' and 'inline-size' properties</h3>
136196

0 commit comments

Comments
 (0)