fix(style-engine): table style base shading as wholeTable layer (SD-3035)#3657
Closed
tupizz wants to merge 1 commit into
Closed
fix(style-engine): table style base shading as wholeTable layer (SD-3035)#3657tupizz wants to merge 1 commit into
tupizz wants to merge 1 commit into
Conversation
A table style's base-level <w:tcPr> (e.g. <w:shd w:fill="F2F2F2"/>) is the wholeTable conditional layer per ECMA-376 17.7.6: Word paints it on every cell of a table referencing the style. The translator stores it on the style definition's own tableCellProperties, a sibling of tableStyleProperties, but resolveConditionalProps only read tableStyleProperties[region], so style-only cell fills were dropped and such tables rendered with no background. Collect the base-level tableCellProperties into the wholeTable chain while walking the basedOn hierarchy, ordered so an explicit tableStyleProperties.wholeTable entry still wins within one definition, a leaf style's base props beat any ancestor's, and inline cell shading wins over everything. Verified against the SD-3035 mutation fixtures: tblStyle_applied, style_plus_direct_border_overrides, and style_plus_width_interactions now paint F2F2F2 on all cells, matching Word's render pixel values. Banding and conditional-region fixtures (first/last row/column, banded rows or columns) are byte-identical before and after, since bands and regions sit above wholeTable in the cascade. Layout corpus compare: 476 docs, zero changes.
Contributor
Author
|
Superseded by #3658, which carries this commit unchanged alongside the SD-3308 double-border fix. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
A table style's base-level w:tcPr shading (e.g. fill F2F2F2) is the wholeTable conditional layer per ECMA-376 17.7.6: Word paints it on every cell of a table that references the style. SuperDoc's cascade only read tableStyleProperties[region] and never the style definition's base-level tableCellProperties, so style-only cell fills were dropped and such tables rendered with no background.
The fix collects the base-level tableCellProperties into the wholeTable chain while walking the basedOn hierarchy. Ordering preserved: explicit wholeTable region entries beat the base level within one definition, leaf styles beat ancestors, bands and conditional regions sit above wholeTable, inline cell shading wins over everything.
Linear: SD-3035
Verification
Notes
Part of the SD-3035 plan. The plan's banding-gate step was dropped after pixel-probing Word's renders proved the four "spurious band" verdicts were misreads: Word paints the same band fills SuperDoc does, so the existing banding behavior is correct and untouched.