Repository navigation
docs: state that box-sizing defaults to border-box, unlike CSS - #39
Open
leshchenko1979 wants to merge 1 commit into
Open
leshchenko1979 wants to merge 1 commit into
leshchenko1979 wants to merge 1 commit into
Conversation
Ogre resolves box-sizing to border-box when the property is absent, which is the opposite of the CSS default. The README listed both accepted values without saying which one applies when the property is omitted, so anyone comparing Ogre output against a browser met the divergence with no warning. - README: the box-sizing bullet names the default, and a new "Differences from CSS" section states the divergence, its reason (Satori compatibility) and the explicit-value escape hatch. - style/resolve.go: comments at the two places that materialise the default, so a later reader does not "fix" it silently. No behavioural change: the default stays border-box. The Macawls#38 probe renders byte-identically before and after. Refs Macawls#38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
box-sizingresolves toborder-boxwhen the property is absent — the opposite of theCSS default.
README.mdlisted both accepted values but never said which one applies whenthe property is omitted, so anyone comparing Ogre output against a browser met the
divergence with no warning.
This documents it. The default is unchanged.
README.md— thebox-sizingbullet names the default; a new### Differences from CSSsection under Supported CSS Properties states the divergence, the reason (Satori
compatibility) and the explicit-value escape hatch.
style/resolve.go— comments at the two places that materialise the default(
mergePropsbaseline,getOrfallback) so a later reader does not "fix" it silently.Before / after
Plus a new section:
Why document rather than change
Reported in #38 with measurements. On a 21-case Chromium comparison suite with one shared
font file, the
border-boxdefault accounts for the two largest remaining divergences(
20-boxsizing-default1.09 %,17-table-div1.20 %); every other case is ≤ 0.77 % andthat residual is glyph antialiasing. Flipping the default would move every layout that
relies on it today and would break Satori-style input that omits
box-sizing— amaintainer decision, hence a docs change here and not a behaviour change.
The explicit-value half is a separate gap, tracked in #26:
box-sizing: content-boxisparsed but not yet read by the layout package (
grep -r BoxSizing layout/is empty), sothe escape hatch the README now mentions starts working when that lands. This PR does not
stack on it.
Verification
go build ./cmd/ogre— exit 0.git diff origin/main --stat—README.md,style/resolve.goonly; the Go diff isthree added comment lines, no code change.
<div style="width:200px;padding:0 50px;background:#f00">x</div>renders abyte-identical SVG from this branch and from
main(md587b96f18fe2173e3135318763215b9c8),200 px wide in both.
style/resolve_test.goalready asserts theborder-boxdefault for an unstyleddiv;untouched, and it is the lock on the decision.
Refs #38