Changeset 194710 in webkit
- Timestamp:
- Jan 7, 2016 12:01:23 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194706 r194710 1 2016-01-07 Zalan Bujtas <zalan@apple.com> 2 3 Incorrect position: fixed; rendering when child of position:relative/sticky. 4 https://bugs.webkit.org/show_bug.cgi?id=147284 5 6 Reviewed by Simon Fraser and David Hyatt. 7 8 Computing logical left for positioned objects should take the relative positioned ancestors' offset 9 into account. 10 11 * fast/block/positioning/fixed-container-with-relative-parent-expected.html: Added. 12 * fast/block/positioning/fixed-container-with-relative-parent.html: Added. 13 * fast/block/positioning/fixed-container-with-sticky-parent-expected.html: Added. 14 * fast/block/positioning/fixed-container-with-sticky-parent.html: Added. 15 1 16 2016-01-07 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r194708 r194710 1 2016-01-07 Zalan Bujtas <zalan@apple.com> 2 3 Incorrect position: fixed; rendering when child of position:relative/sticky. 4 https://bugs.webkit.org/show_bug.cgi?id=147284 5 6 Reviewed by Simon Fraser and David Hyatt. 7 8 Computing logical left for positioned objects should take the relative positioned ancestors' offset 9 into account. 10 11 Tests: fast/block/positioning/fixed-container-with-relative-parent.html 12 fast/block/positioning/fixed-container-with-sticky-parent.html 13 14 * rendering/RenderBox.cpp: 15 (WebCore::computeInlineStaticDistance): 16 1 17 2016-01-06 Simon Fraser <simon.fraser@apple.com> 2 18 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r194514 r194710 3332 3332 LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft(); 3333 3333 for (auto* current = child->parent(); current && current != containerBlock; current = current->container()) { 3334 if (is<RenderBox>(*current)) { 3335 staticPosition += downcast<RenderBox>(*current).logicalLeft(); 3336 if (region && is<RenderBlock>(*current)) { 3337 const RenderBlock& currentBlock = downcast<RenderBlock>(*current); 3338 region = currentBlock.clampToStartAndEndRegions(region); 3339 RenderBoxRegionInfo* boxInfo = currentBlock.renderBoxRegionInfo(region); 3340 if (boxInfo) 3341 staticPosition += boxInfo->logicalLeft(); 3342 } 3334 if (!is<RenderBox>(*current)) 3335 continue; 3336 const auto& renderBox = downcast<RenderBox>(*current); 3337 staticPosition += renderBox.logicalLeft(); 3338 if (renderBox.isInFlowPositioned()) 3339 staticPosition += renderBox.isHorizontalWritingMode() ? renderBox.offsetForInFlowPosition().width() : renderBox.offsetForInFlowPosition().height(); 3340 if (region && is<RenderBlock>(*current)) { 3341 const RenderBlock& currentBlock = downcast<RenderBlock>(*current); 3342 region = currentBlock.clampToStartAndEndRegions(region); 3343 RenderBoxRegionInfo* boxInfo = currentBlock.renderBoxRegionInfo(region); 3344 if (boxInfo) 3345 staticPosition += boxInfo->logicalLeft(); 3343 3346 } 3344 3347 } 3345 3348 logicalLeft.setValue(Fixed, staticPosition); 3346 3349 } else { 3347 RenderBox& enclosingBox = child->parent()->enclosingBox();3350 const RenderBox& enclosingBox = child->parent()->enclosingBox(); 3348 3351 LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft(); 3349 for ( RenderElement* current = &enclosingBox; current; current = current->container()) {3352 for (const RenderElement* current = &enclosingBox; current; current = current->container()) { 3350 3353 if (is<RenderBox>(*current)) { 3351 if (current != containerBlock) 3352 staticPosition -= downcast<RenderBox>(*current).logicalLeft(); 3354 if (current != containerBlock) { 3355 const auto& renderBox = downcast<RenderBox>(*current); 3356 staticPosition -= renderBox.logicalLeft(); 3357 if (renderBox.isInFlowPositioned()) 3358 staticPosition -= renderBox.isHorizontalWritingMode() ? renderBox.offsetForInFlowPosition().width() : renderBox.offsetForInFlowPosition().height(); 3359 } 3353 3360 if (current == &enclosingBox) 3354 3361 staticPosition -= enclosingBox.logicalWidth(); … … 3714 3721 LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore(); 3715 3722 for (RenderElement* container = child->parent(); container && container != containerBlock; container = container->container()) { 3716 if (is<RenderBox>(*container) && !is<RenderTableRow>(*container)) 3717 staticLogicalTop += downcast<RenderBox>(*container).logicalTop(); 3723 if (!is<RenderBox>(*container)) 3724 continue; 3725 const auto& renderBox = downcast<RenderBox>(*container); 3726 if (!is<RenderTableRow>(renderBox)) 3727 staticLogicalTop += renderBox.logicalTop(); 3728 if (renderBox.isInFlowPositioned()) 3729 staticLogicalTop += renderBox.isHorizontalWritingMode() ? renderBox.offsetForInFlowPosition().height() : renderBox.offsetForInFlowPosition().width(); 3718 3730 } 3719 3731 logicalTop.setValue(Fixed, staticLogicalTop);
Note: See TracChangeset
for help on using the changeset viewer.