WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
157455
Absolute positioned element is not placed properly when parent becomes the containing block.
https://bugs.webkit.org/show_bug.cgi?id=157455
Summary
Absolute positioned element is not placed properly when parent becomes the co...
zalan
Reported
2016-05-07 15:49:32 PDT
Created
attachment 278345
[details]
Test case When the parent becomes the containing block by setting transform on it. (-by using timeout) -see test case
Attachments
Test case
(742 bytes, text/html)
2016-05-07 15:49 PDT
,
zalan
no flags
Details
Patch
(11.51 KB, patch)
2016-05-10 21:24 PDT
,
zalan
simon.fraser
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
zalan
Comment 1
2016-05-10 19:14:48 PDT
rdar://problem/26212568
zalan
Comment 2
2016-05-10 21:24:30 PDT
Created
attachment 278576
[details]
Patch
Simon Fraser (smfr)
Comment 3
2016-05-11 09:53:13 PDT
Comment on
attachment 278576
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278576&action=review
> Source/WebCore/ChangeLog:10 > + When a container becomes a containing block, we need to check if there's any positioned box in its subtree > + in order to "re-parent" them. It basically means that we remove them from RenderBlock::positionedDescendants map
"...if there is ... to reparent it", or "if there are...to reparent them". Don't mix singular and plural!
> Source/WebCore/rendering/RenderBlock.cpp:243 > + if (oldStyle.position() == newStyle.position() && hadTransform == willHaveTransform)
This is OK but I would prefer we add RenderStyle::containingBlockForPositioned(), or positionedOrTransformed() or something. I bet we need the same logic elsewhere.
> Source/WebCore/rendering/RenderBlock.cpp:260 > + && (containingBlock->style().position() == StaticPosition || (containingBlock->isInline() && !containingBlock->isReplaced()))) {
Would be nice to wrap this conditional in a function so I know what you're checking. Why inline and not replaced! I think this pattern exists in multiple places. Could be done separately.
zalan
Comment 4
2016-05-11 19:04:01 PDT
(In reply to
comment #3
)
> Comment on
attachment 278576
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=278576&action=review
> > > Source/WebCore/ChangeLog:10 > > + When a container becomes a containing block, we need to check if there's any positioned box in its subtree > > + in order to "re-parent" them. It basically means that we remove them from RenderBlock::positionedDescendants map > > "...if there is ... to reparent it", or "if there are...to reparent them". > Don't mix singular and plural! > > > Source/WebCore/rendering/RenderBlock.cpp:243 > > + if (oldStyle.position() == newStyle.position() && hadTransform == willHaveTransform) > > This is OK but I would prefer we add > RenderStyle::containingBlockForPositioned(), or positionedOrTransformed() or > something. I bet we need the same logic elsewhere.
There are a couple of places where we use similar logic (requiresLayer and canContainAbsolutelyPositionedObjects) but it seems like we explicitly write out all the requires properties there.
> > > Source/WebCore/rendering/RenderBlock.cpp:260 > > + && (containingBlock->style().position() == StaticPosition || (containingBlock->isInline() && !containingBlock->isReplaced()))) { > > Would be nice to wrap this conditional in a function so I know what you're > checking. Why inline and not replaced! I think this pattern exists in > multiple places. > > Could be done separately.
Ok. I'll do it in a follow-up patch.
zalan
Comment 5
2016-05-11 19:09:12 PDT
Committed
r200736
: <
http://trac.webkit.org/changeset/200736
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug