Summary: | [CSS Grid Layout] Updating -webkit-grid-rows or -webkit-grid-columns doesn't work as expected | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Julien Chaffraix <jchaffraix> | ||||||
Component: | Layout and Rendering | Assignee: | Julien Chaffraix <jchaffraix> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | donggwan.kim, eric, ojan.autocc, ojan, tony, webkit.review.bot, xan.lopez | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 60731 | ||||||||
Attachments: |
|
Description
Julien Chaffraix
2013-01-16 16:42:32 PST
Created attachment 183071 [details]
Proposed fix 1: Force a relayout if the grid area size changed and fixed a boolean logic in the style diff method.
Comment on attachment 183071 [details] Proposed fix 1: Force a relayout if the grid area size changed and fixed a boolean logic in the style diff method. View in context: https://bugs.webkit.org/attachment.cgi?id=183071&action=review > Source/WebCore/rendering/RenderGrid.cpp:236 > + LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit(); > + LayoutUnit oldOverrideContainingBlockContentLogicalHeight = child->hasOverrideContainingBlockLogicalHeight() ? child->overrideContainingBlockContentLogicalHeight() : LayoutUnit(); > + LayoutUnit newOverrideContainingBlockContentLogicalWidth = columnTracks[columnTrack].m_usedBreadth; > + LayoutUnit newOverrideContainingBlockContentLogicalHeight = rowTracks[rowTrack].m_usedBreadth; This is pretty hard to read. How about: LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit(); LayoutUnit oldOverrideContainingBlockContentLogicalHeight = child->hasOverrideContainingBlockLogicalHeight() ? child->overrideContainingBlockContentLogicalHeight() : LayoutUnit(); bool widthOrHeightChanged = oldOverrideContainingBlockContentLogicalWidth != columnTracks[columnTrack].m_usedBreadth || oldOverrideContainingBlockContentLogicalHeight != rowTracks[rowTrack].m_usedBreadth; if (widthOrHeightChanged) child->setNeedsLayout(true, MarkOnlyThis); child->setOverride... child->setOverride... Comment on attachment 183071 [details] Proposed fix 1: Force a relayout if the grid area size changed and fixed a boolean logic in the style diff method. View in context: https://bugs.webkit.org/attachment.cgi?id=183071&action=review >> Source/WebCore/rendering/RenderGrid.cpp:236 >> + LayoutUnit newOverrideContainingBlockContentLogicalHeight = rowTracks[rowTrack].m_usedBreadth; > > This is pretty hard to read. How about: > LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit(); > LayoutUnit oldOverrideContainingBlockContentLogicalHeight = child->hasOverrideContainingBlockLogicalHeight() ? child->overrideContainingBlockContentLogicalHeight() : LayoutUnit(); > > bool widthOrHeightChanged = oldOverrideContainingBlockContentLogicalWidth != columnTracks[columnTrack].m_usedBreadth || oldOverrideContainingBlockContentLogicalHeight != rowTracks[rowTrack].m_usedBreadth; > if (widthOrHeightChanged) > child->setNeedsLayout(true, MarkOnlyThis); > > child->setOverride... > child->setOverride... No issue with transforming the code, will change it before landing. Created attachment 183220 [details]
Patch for landing
Comment on attachment 183220 [details] Patch for landing Clearing flags on attachment: 183220 Committed r140045: <http://trac.webkit.org/changeset/140045> All reviewed patches have been landed. Closing bug. |