Skip to content

Commit

Permalink
Merge r232663 - REGRESSION (r230480): Cannot adjust photo position on…
Browse files Browse the repository at this point in the history
… LinkedIn's profile page

https://bugs.webkit.org/show_bug.cgi?id=186464
<rdar://problem/40369448>

Reviewed by Simon Fraser.

Source/WebCore:

The optimization logic for skipping image layout when we only need overflow computation should check if the image actually needs
simplified layout only. The needsSimplifiedNormalFlowLayout() flag means that the overflow information needs to be updated but
it does not mean that overflow is the only property that we need to recompute.

Test: fast/images/positioned-image-when-transform-is-present.html

* rendering/RenderImage.cpp:
(WebCore::RenderImage::layout):
* rendering/RenderObject.h:
(WebCore::RenderObject::needsSimplifiedNormalFlowLayoutOnly const):

LayoutTests:

* fast/images/positioned-image-when-transform-is-present-expected.html: Added.
* fast/images/positioned-image-when-transform-is-present.html: Added.
  • Loading branch information
alanbaradlay authored and carlosgcampos committed Jun 11, 2018
1 parent e3696fc commit f58d194
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 1 deletion.
11 changes: 11 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
2018-06-09 Zalan Bujtas <zalan@apple.com>

REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page
https://bugs.webkit.org/show_bug.cgi?id=186464
<rdar://problem/40369448>

Reviewed by Simon Fraser.

* fast/images/positioned-image-when-transform-is-present-expected.html: Added.
* fast/images/positioned-image-when-transform-is-present.html: Added.

2018-05-17 Carlos Alberto Lopez Perez <clopez@igalia.com>

[WPE] Implement and enable FULLSCREEN_API
Expand Down
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>This tests that we reposition the image when transform is present.</title>
</head>
<body>
PASS if the image disappears completely.
</body>
</html>
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>This tests that we reposition the image when transform is present.</title>
<style>
img {
position: absolute;
top: 10px;
left: 10px;
width: 100px;
height: 100px;
transform: translateX(0px);
}

div {
position: relative;
width: 100px;
height: 100px;
overflow: hidden;
}
</style>
</head>
<body>
PASS if the image disappears completely.
<div><img id=moveOut src="foobar-broken.jpg"></div>
<script>
document.body.offsetHeight;
moveOut.style.transform = "translateX(1px)";
moveOut.style.left = "200px";
</script>
</body>
</html>
19 changes: 19 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,22 @@
2018-06-09 Zalan Bujtas <zalan@apple.com>

REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page
https://bugs.webkit.org/show_bug.cgi?id=186464
<rdar://problem/40369448>

Reviewed by Simon Fraser.

The optimization logic for skipping image layout when we only need overflow computation should check if the image actually needs
simplified layout only. The needsSimplifiedNormalFlowLayout() flag means that the overflow information needs to be updated but
it does not mean that overflow is the only property that we need to recompute.

Test: fast/images/positioned-image-when-transform-is-present.html

* rendering/RenderImage.cpp:
(WebCore::RenderImage::layout):
* rendering/RenderObject.h:
(WebCore::RenderObject::needsSimplifiedNormalFlowLayoutOnly const):

2018-06-10 Michael Catanzaro <mcatanzaro@igalia.com>

[WPE][GTK] paypal.com requires user agent quirk
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderImage.cpp
Expand Up @@ -700,7 +700,7 @@ bool RenderImage::canHaveChildren() const
void RenderImage::layout()
{
// Recomputing overflow is required only when child content is present.
if (needsSimplifiedNormalFlowLayout() && !m_hasShadowControls) {
if (needsSimplifiedNormalFlowLayoutOnly() && !m_hasShadowControls) {
clearNeedsLayout();
return;
}
Expand Down
7 changes: 7 additions & 0 deletions Source/WebCore/rendering/RenderObject.h
Expand Up @@ -474,6 +474,7 @@ class RenderObject : public CachedImageClient {

bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); }
bool needsSimplifiedNormalFlowLayout() const { return m_bitfields.needsSimplifiedNormalFlowLayout(); }
bool needsSimplifiedNormalFlowLayoutOnly() const;
bool normalChildNeedsLayout() const { return m_bitfields.normalChildNeedsLayout(); }

bool preferredLogicalWidthsDirty() const { return m_bitfields.preferredLogicalWidthsDirty(); }
Expand Down Expand Up @@ -1089,6 +1090,12 @@ inline bool RenderObject::backgroundIsKnownToBeObscured(const LayoutPoint& paint
return m_bitfields.boxDecorationState() == HasBoxDecorationsAndBackgroundIsKnownToBeObscured;
}

inline bool RenderObject::needsSimplifiedNormalFlowLayoutOnly() const
{
return m_bitfields.needsSimplifiedNormalFlowLayout() && !m_bitfields.needsLayout() && !m_bitfields.normalChildNeedsLayout()
&& !m_bitfields.posChildNeedsLayout() && !m_bitfields.needsPositionedMovementLayout();
}

#if ENABLE(TREE_DEBUGGING)
void printRenderTreeForLiveDocuments();
void printLayerTreeForLiveDocuments();
Expand Down

0 comments on commit f58d194

Please sign in to comment.