| Summary: | Fix inline-block abspos bug | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bfulgham, karlcow, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Ahmad Saleem
2022-12-15 07:08:32 PST
This seems to be repaint issue because resizing window make it looks similar to Chrome Canary 112 and Firefox Nightly 112.
I tried in local testing and this compiles:
if ((oldStyle && isOutOfFlowPositioned() && parent() && (parent() != containingBlock()))
&& (style().position() == oldStyle->position())
&& (style().display() != oldStyle->display())
&& ((style().display() == DisplayType::Block) || (style().display() == DisplayType::InlineBlock))
&& ((oldStyle->display() == DisplayType::Block ) || (oldStyle->display() == DisplayType::InlineBlock)))
parent()->setChildNeedsLayout(MarkOnlyThis);
_______
I tried to change "last line" with:
setNeedsLayout() and other child variants to force repainting to get this fixed but it seems it does not work in case of Safari.
Would appreciate any input or suggestion. Just wanted to share my input and progress in the background on fixing this bug. Thanks!
(In reply to Ahmad Saleem from comment #2) > This seems to be repaint issue because resizing window make it looks similar > to Chrome Canary 112 and Firefox Nightly 112. > > I tried in local testing and this compiles: > > if ((oldStyle && isOutOfFlowPositioned() && parent() && (parent() != > containingBlock())) > && (style().position() == oldStyle->position()) > && (style().display() != oldStyle->display()) > && ((style().display() == DisplayType::Block) || (style().display() > == DisplayType::InlineBlock)) > && ((oldStyle->display() == DisplayType::Block ) || > (oldStyle->display() == DisplayType::InlineBlock))) > parent()->setChildNeedsLayout(MarkOnlyThis); > > _______ > > I tried to change "last line" with: > > setNeedsLayout() and other child variants to force repainting to get this > fixed but it seems it does not work in case of Safari. > > Would appreciate any input or suggestion. Just wanted to share my input and > progress in the background on fixing this bug. Thanks! I think parent()->setNeedsLayout(LayoutInvalidationReason::ChildChanged, MarkContainerChain); maps to parent()->setChildNeedsLayout(); (In reply to zalan from comment #3) > (In reply to Ahmad Saleem from comment #2) > > This seems to be repaint issue because resizing window make it looks similar > > to Chrome Canary 112 and Firefox Nightly 112. > > > > I tried in local testing and this compiles: > > > > if ((oldStyle && isOutOfFlowPositioned() && parent() && (parent() != > > containingBlock())) > > && (style().position() == oldStyle->position()) > > && (style().display() != oldStyle->display()) > > && ((style().display() == DisplayType::Block) || (style().display() > > == DisplayType::InlineBlock)) > > && ((oldStyle->display() == DisplayType::Block ) || > > (oldStyle->display() == DisplayType::InlineBlock))) > > parent()->setChildNeedsLayout(MarkOnlyThis); > > > > _______ > > > > I tried to change "last line" with: > > > > setNeedsLayout() and other child variants to force repainting to get this > > fixed but it seems it does not work in case of Safari. > > > > Would appreciate any input or suggestion. Just wanted to share my input and > > progress in the background on fixing this bug. Thanks! > I think parent()->setNeedsLayout(LayoutInvalidationReason::ChildChanged, > MarkContainerChain); maps to parent()->setChildNeedsLayout(); Just tried on local build. Still it does have repaint bug where resizing make it aligned with Chrome Canary 112 and Firefox Nightly 112. (In reply to Ahmad Saleem from comment #4) > (In reply to zalan from comment #3) > > (In reply to Ahmad Saleem from comment #2) > > > This seems to be repaint issue because resizing window make it looks similar > > > to Chrome Canary 112 and Firefox Nightly 112. > > > > > > I tried in local testing and this compiles: > > > > > > if ((oldStyle && isOutOfFlowPositioned() && parent() && (parent() != > > > containingBlock())) > > > && (style().position() == oldStyle->position()) > > > && (style().display() != oldStyle->display()) > > > && ((style().display() == DisplayType::Block) || (style().display() > > > == DisplayType::InlineBlock)) > > > && ((oldStyle->display() == DisplayType::Block ) || > > > (oldStyle->display() == DisplayType::InlineBlock))) > > > parent()->setChildNeedsLayout(MarkOnlyThis); > > > > > > _______ > > > > > > I tried to change "last line" with: > > > > > > setNeedsLayout() and other child variants to force repainting to get this > > > fixed but it seems it does not work in case of Safari. > > > > > > Would appreciate any input or suggestion. Just wanted to share my input and > > > progress in the background on fixing this bug. Thanks! > > I think parent()->setNeedsLayout(LayoutInvalidationReason::ChildChanged, > > MarkContainerChain); maps to parent()->setChildNeedsLayout(); > > Just tried on local build. Still it does have repaint bug where resizing > make it aligned with Chrome Canary 112 and Firefox Nightly 112. FIXED it: if ((oldStyle && isOutOfFlowPositioned() && parent() && (parent() != containingBlock())) && (style().position() == oldStyle->position()) && (style().isOriginalDisplayInlineType() != oldStyle->isOriginalDisplayInlineType()) && ((style().isOriginalDisplayBlockType()) || (style().isOriginalDisplayInlineType())) && ((oldStyle->isOriginalDisplayBlockType()) || (oldStyle->isOriginalDisplayInlineType()))) parent()->setChildNeedsLayout(); PR - https://github.com/WebKit/WebKit/pull/11781/files In local testing, it passes this feeling test from JSFiddle of Comment 0. Running through EWS and will rebase any failing test tomorrow morning. Committed 262042@main (47b7f1121f2e): <https://commits.webkit.org/262042@main> Reviewed commits have been landed. Closing PR #11781 and removing active labels. |