[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-changes
Subject:    [webkit-changes] [239502] trunk
From:       rego () igalia ! com
Date:       2018-12-21 12:29:58
Message-ID: 20181221122958.2639410051CE () svn ! webkit ! org
[Download RAW message or body]

[Attachment #2 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[239502] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt;  } #msg dl a { font-weight: \
bold} #msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
 #patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
                .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://trac.webkit.org/projects/webkit/changeset/239502">239502</a></dd> \
<dt>Author</dt> <dd>rego@igalia.com</dd> <dt>Date</dt> <dd>2018-12-21 04:29:57 -0800 \
(Fri, 21 Dec 2018)</dd> </dl>

<h3>Log Message</h3>
<pre>[css-grid] Fix percentages in relative offsets for grid items
https://bugs.webkit.org/show_bug.cgi?id=190492

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002-expected.txt:
  Update expected file as we're now passing this test.

Source/WebCore:

The method RenderBoxModelObject::relativePositionOffset() was not considering the \
case of grid items, where the containing block is the grid area.
The patch modifies the method so the new code uses \
overrideContainingBlockContentWidth|Height when required.

Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html


* rendering/RenderBox.cpp: Implement the physical versions of the already existent \
methods. (WebCore::RenderBox::overrideContainingBlockContentWidth const):
(WebCore::RenderBox::overrideContainingBlockContentHeight const):
(WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
(WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
to take into account overrideContainingBlockContentWidth|Height for grid items.
* rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
that will be overridden in RenderBox.
(WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
(WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
(WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
(WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
 <li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditems \
relativeoffsets002expectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002-expected.txt</a></li>
 <li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
 <li><a href="#trunkSourceWebCorerenderingRenderBoxh">trunk/Source/WebCore/rendering/RenderBox.h</a></li>
 <li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
 <li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjecth">trunk/Source/WebCore/rendering/RenderBoxModelObject.h</a></li>
 </ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (239501 \
=> 239502)</h4> <pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-12-21 11:47:28 \
                UTC (rev 239501)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-12-21 12:29:57 UTC (rev 239502)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2018-12-21  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix percentages in relative offsets for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=190492
+
+        Reviewed by Sergio Villar Senin.
+
+        * web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002-expected.txt:
 +          Update expected file as we're now passing this test.
+
</ins><span class="cx"> 2018-12-19  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove RTCRtpTransceiver.setDirection
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscssgridgriditemsgriditemsrelativeoffsets002expectedtxt"></a>
 <div class="modfile"><h4>Modified: \
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002-expected.txt \
(239501 => 239502)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002-expected.txt	2018-12-21 \
                11:47:28 UTC (rev 239501)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002-expected.txt	2018-12-21 \
12:29:57 UTC (rev 239502) </span><span class="lines">@@ -1,46 +1,10 @@
</span><span class="cx"> 
</span><del>-FAIL .grid 1 assert_equals: 
-&lt;div class=&quot;grid verticalRL directionRTL&quot;&gt;
-  &lt;div class=&quot;firstRowFirstColumn&quot; style=&quot;left: 10%; top: \
5%;&quot; data-offset-x=&quot;219&quot; data-offest-y=&quot;10&quot; \
data-expected-width=&quot;90&quot; \
                data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;secondRowSecondColumn&quot; style=&quot;left: -20%; top: \
-10%;&quot; data-offset-x=&quot;138&quot; data-offest-y=&quot;75&quot; \
data-expected-width=&quot;60&quot; \
                data-expected-height=&quot;150&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;thirdRowThirdColumn&quot; style=&quot;right: 70%; bottom: \
30%;&quot; data-offset-x=&quot;99&quot; data-offest-y=&quot;120&quot; \
data-expected-width=&quot;30&quot; \
                data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-&lt;/div&gt;
-offsetLeft expected 219 but got 240
-FAIL .grid 2 assert_equals: 
-&lt;div class=&quot;grid verticalRL&quot;&gt;
-  &lt;div class=&quot;firstRowFirstColumn&quot; style=&quot;left: 10%; top: \
5%;&quot; data-offset-x=&quot;219&quot; data-offest-y=&quot;10&quot; \
data-expected-width=&quot;90&quot; \
                data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;secondRowSecondColumn&quot; style=&quot;left: -20%; top: \
-10%;&quot; data-offset-x=&quot;138&quot; data-offest-y=&quot;75&quot; \
data-expected-width=&quot;60&quot; \
                data-expected-height=&quot;150&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;thirdRowThirdColumn&quot; style=&quot;right: 70%; bottom: \
30%;&quot; data-offset-x=&quot;99&quot; data-offest-y=&quot;120&quot; \
data-expected-width=&quot;30&quot; \
                data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-&lt;/div&gt;
-offsetLeft expected 219 but got 240
-FAIL .grid 3 assert_equals: 
-&lt;div class=&quot;grid verticalLR directionRTL&quot;&gt;
-  &lt;div class=&quot;firstRowFirstColumn&quot; style=&quot;left: 10%; top: \
5%;&quot; data-offset-x=&quot;9&quot; data-offest-y=&quot;10&quot; \
data-expected-width=&quot;90&quot; \
                data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;secondRowSecondColumn&quot; style=&quot;left: -20%; top: \
-10%;&quot; data-offset-x=&quot;78&quot; data-offest-y=&quot;75&quot; \
data-expected-width=&quot;60&quot; \
                data-expected-height=&quot;150&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;thirdRowThirdColumn&quot; style=&quot;right: 70%; bottom: \
30%;&quot; data-offset-x=&quot;129&quot; data-offest-y=&quot;120&quot; \
data-expected-width=&quot;30&quot; \
                data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-&lt;/div&gt;
-offsetLeft expected 9 but got 30
-FAIL .grid 4 assert_equals: 
-&lt;div class=&quot;grid verticalLR&quot;&gt;
-  &lt;div class=&quot;firstRowFirstColumn&quot; style=&quot;left: 10%; top: \
5%;&quot; data-offset-x=&quot;9&quot; data-offest-y=&quot;10&quot; \
data-expected-width=&quot;90&quot; \
                data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;secondRowSecondColumn&quot; style=&quot;left: -20%; top: \
-10%;&quot; data-offset-x=&quot;78&quot; data-offest-y=&quot;75&quot; \
data-expected-width=&quot;60&quot; \
                data-expected-height=&quot;150&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;thirdRowThirdColumn&quot; style=&quot;right: 70%; bottom: \
30%;&quot; data-offset-x=&quot;129&quot; data-offest-y=&quot;120&quot; \
data-expected-width=&quot;30&quot; \
                data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-&lt;/div&gt;
-offsetLeft expected 9 but got 30
-FAIL .grid 5 assert_equals: 
-&lt;div class=&quot;grid directionRTL&quot;&gt;
-  &lt;div class=&quot;firstRowFirstColumn&quot; style=&quot;left: 5%; top: \
10%;&quot; data-offset-x=&quot;410&quot; data-offest-y=&quot;9&quot; \
data-expected-width=&quot;200&quot; \
                data-expected-height=&quot;90&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;secondRowSecondColumn&quot; style=&quot;left: -10%; top: \
-20%;&quot; data-offset-x=&quot;235&quot; data-offest-y=&quot;78&quot; \
data-expected-width=&quot;150&quot; \
                data-expected-height=&quot;60&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;thirdRowThirdColumn&quot; style=&quot;right: 30%; bottom: \
70%;&quot; data-offset-x=&quot;120&quot; data-offest-y=&quot;129&quot; \
data-expected-width=&quot;100&quot; \
                data-expected-height=&quot;30&quot;&gt;&lt;/div&gt;
-&lt;/div&gt;
-offsetLeft expected 410 but got 430
-FAIL .grid 6 assert_equals: 
-&lt;div class=&quot;grid&quot;&gt;
-  &lt;div class=&quot;firstRowFirstColumn&quot; style=&quot;left: 5%; top: \
10%;&quot; data-offset-x=&quot;10&quot; data-offest-y=&quot;9&quot; \
data-expected-width=&quot;200&quot; \
                data-expected-height=&quot;90&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;secondRowSecondColumn&quot; style=&quot;left: -10%; top: \
-20%;&quot; data-offset-x=&quot;185&quot; data-offest-y=&quot;78&quot; \
data-expected-width=&quot;150&quot; \
                data-expected-height=&quot;60&quot;&gt;&lt;/div&gt;
-  &lt;div class=&quot;thirdRowThirdColumn&quot; style=&quot;right: 30%; bottom: \
70%;&quot; data-offset-x=&quot;320&quot; data-offest-y=&quot;129&quot; \
data-expected-width=&quot;100&quot; \
                data-expected-height=&quot;30&quot;&gt;&lt;/div&gt;
-&lt;/div&gt;
-offsetLeft expected 10 but got 30
</del><ins>+PASS .grid 1 
+PASS .grid 2 
+PASS .grid 3 
+PASS .grid 4 
+PASS .grid 5 
+PASS .grid 6 
</ins><span class="cx"> Direction LTR
</span><span class="cx"> 
</span><span class="cx"> Direction RTL
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (239501 => \
239502)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog	2018-12-21 11:47:28 UTC (rev \
                239501)
+++ trunk/Source/WebCore/ChangeLog	2018-12-21 12:29:57 UTC (rev 239502)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2018-12-21  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix percentages in relative offsets for grid items
+        https://bugs.webkit.org/show_bug.cgi?id=190492
+
+        Reviewed by Sergio Villar Senin.
+
+        The method RenderBoxModelObject::relativePositionOffset() was not \
considering the case of grid items, +        where the containing block is the grid \
area. +        The patch modifies the method so the new code uses \
overrideContainingBlockContentWidth|Height when required. +
+        Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
 +
+        * rendering/RenderBox.cpp: Implement the physical versions of the already \
existent methods. +        (WebCore::RenderBox::overrideContainingBlockContentWidth \
const): +        (WebCore::RenderBox::overrideContainingBlockContentHeight const):
+        (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
+        (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
+        * rendering/RenderBox.h:
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified \
method +        to take into account overrideContainingBlockContentWidth|Height for \
grid items. +        * rendering/RenderBoxModelObject.h: Added new headers for \
physical virtual methods +        that will be overridden in RenderBox.
+        (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
+        (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
+        (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth \
const): +        (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight \
const): +
</ins><span class="cx"> 2018-12-20  Justin Fan  &lt;justin_fan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebGPU] Convert WebGPUBindGroups into \
MTLArgumentEncoders </span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp \
(239501 => 239502)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp	2018-12-21 \
                11:47:28 UTC (rev 239501)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2018-12-21 12:29:57 UTC (rev 239502)
</span><span class="lines">@@ -98,6 +98,7 @@
</span><span class="cx"> static OverrideSizeMap* gOverrideContentLogicalWidthMap = \
nullptr; </span><span class="cx"> 
</span><span class="cx"> // Used by grid elements to properly size their grid items.
</span><ins>+// FIXME: We should store these based on physical direction.
</ins><span class="cx"> typedef WTF::HashMap&lt;const RenderBox*, \
Optional&lt;LayoutUnit&gt;&gt; OverrideOptionalSizeMap; </span><span class="cx"> \
static OverrideOptionalSizeMap* gOverrideContainingBlockContentLogicalHeightMap = \
nullptr; </span><span class="cx"> static OverrideOptionalSizeMap* \
gOverrideContainingBlockContentLogicalWidthMap = nullptr; </span><span \
class="lines">@@ -1086,6 +1087,44 @@ </span><span class="cx">     return \
gOverrideContentLogicalHeightMap-&gt;get(this); </span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Optional&lt;LayoutUnit&gt; \
RenderBox::overrideContainingBlockContentWidth() const +{
+    ASSERT(hasOverrideContainingBlockContentWidth());
+    return containingBlock()-&gt;style().isHorizontalWritingMode()
+        ? gOverrideContainingBlockContentLogicalWidthMap-&gt;get(this)
+        : gOverrideContainingBlockContentLogicalHeightMap-&gt;get(this);
+}
+
+Optional&lt;LayoutUnit&gt; RenderBox::overrideContainingBlockContentHeight() const
+{
+    ASSERT(hasOverrideContainingBlockContentHeight());
+    return containingBlock()-&gt;style().isHorizontalWritingMode()
+        ? gOverrideContainingBlockContentLogicalHeightMap-&gt;get(this)
+        : gOverrideContainingBlockContentLogicalWidthMap-&gt;get(this);
+}
+
+bool RenderBox::hasOverrideContainingBlockContentWidth() const
+{
+    RenderBlock* cb = containingBlock();
+    if (!cb)
+        return false;
+
+    return cb-&gt;style().isHorizontalWritingMode()
+        ? gOverrideContainingBlockContentLogicalWidthMap &amp;&amp; \
gOverrideContainingBlockContentLogicalWidthMap-&gt;contains(this) +        : \
gOverrideContainingBlockContentLogicalHeightMap &amp;&amp; \
gOverrideContainingBlockContentLogicalHeightMap-&gt;contains(this); +}
+
+bool RenderBox::hasOverrideContainingBlockContentHeight() const
+{
+    RenderBlock* cb = containingBlock();
+    if (!cb)
+        return false;
+
+    return cb-&gt;style().isHorizontalWritingMode()
+        ? gOverrideContainingBlockContentLogicalHeightMap &amp;&amp; \
gOverrideContainingBlockContentLogicalHeightMap-&gt;contains(this) +        : \
gOverrideContainingBlockContentLogicalHeightMap &amp;&amp; \
gOverrideContainingBlockContentLogicalHeightMap-&gt;contains(this); +}
+
</ins><span class="cx"> Optional&lt;LayoutUnit&gt; \
RenderBox::overrideContainingBlockContentLogicalWidth() const </span><span \
class="cx"> { </span><span class="cx">     \
ASSERT(hasOverrideContainingBlockContentLogicalWidth()); </span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.h (239501 \
=> 239502)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.h	2018-12-21 11:47:28 \
                UTC (rev 239501)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2018-12-21 12:29:57 UTC (rev 239502)
</span><span class="lines">@@ -314,6 +314,10 @@
</span><span class="cx">     void clearOverrideContentLogicalHeight();
</span><span class="cx">     void clearOverrideContentLogicalWidth();
</span><span class="cx"> 
</span><ins>+    Optional&lt;LayoutUnit&gt; overrideContainingBlockContentWidth() \
const override; +    Optional&lt;LayoutUnit&gt; \
overrideContainingBlockContentHeight() const override; +    bool \
hasOverrideContainingBlockContentWidth() const override; +    bool \
hasOverrideContainingBlockContentHeight() const override; </ins><span class="cx">     \
Optional&lt;LayoutUnit&gt; overrideContainingBlockContentLogicalWidth() const; \
</span><span class="cx">     Optional&lt;LayoutUnit&gt; \
overrideContainingBlockContentLogicalHeight() const; </span><span class="cx">     \
bool hasOverrideContainingBlockContentLogicalWidth() const; \
</span></span></pre></div> <a \
id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a> <div \
class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp \
(239501 => 239502)</h4> <pre class="diff"><span>
<span class="info">--- \
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2018-12-21 11:47:28 UTC (rev \
                239501)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2018-12-21 12:29:57 UTC \
(rev 239502) </span><span class="lines">@@ -401,13 +401,18 @@
</span><span class="cx">     // in the case of relative positioning using \
percentages, we can't do this.  The offset should always be resolved using the \
</span><span class="cx">     // available width of the containing block.  Therefore \
we don't use containingBlockLogicalWidthForContent() here, but instead explicitly \
</span><span class="cx">     // call availableWidth on our containing block. \
                </span><del>-    if (!style().left().isAuto()) {
-        if (!style().right().isAuto() &amp;&amp; \
                !containingBlock()-&gt;style().isLeftToRightDirection())
-            offset.setWidth(-valueForLength(style().right(), \
                !style().right().isFixed() ? containingBlock()-&gt;availableWidth() : \
                0_lu));
-        else
-            offset.expand(valueForLength(style().left(), !style().left().isFixed() ? \
                containingBlock()-&gt;availableWidth() : 0_lu), 0_lu);
-    } else if (!style().right().isAuto()) {
-        offset.expand(-valueForLength(style().right(), !style().right().isFixed() ? \
containingBlock()-&gt;availableWidth() : 0_lu), 0_lu); </del><ins>+    // However for \
grid items the containing block is the grid area, so offsets should be resolved \
against that: +    // https://drafts.csswg.org/css-grid/#grid-item-sizing
+    if (!style().left().isAuto() || !style().right().isAuto()) {
+        LayoutUnit availableWidth = hasOverrideContainingBlockContentWidth()
+            ? overrideContainingBlockContentWidth().valueOr(LayoutUnit()) : \
containingBlock()-&gt;availableWidth(); +        if (!style().left().isAuto()) {
+            if (!style().right().isAuto() &amp;&amp; \
!containingBlock()-&gt;style().isLeftToRightDirection()) +                \
offset.setWidth(-valueForLength(style().right(), !style().right().isFixed() ? \
availableWidth : 0_lu)); +            else
+                offset.expand(valueForLength(style().left(), \
!style().left().isFixed() ? availableWidth : 0_lu), 0_lu); +        } else if \
(!style().right().isAuto()) +            \
offset.expand(-valueForLength(style().right(), !style().right().isFixed() ? \
availableWidth : 0_lu), 0_lu); </ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If the containing block of a relatively positioned \
element does not </span><span class="lines">@@ -416,17 +421,29 @@
</span><span class="cx">     // where &lt;html&gt; and &lt;body&gt; assume the size \
of the viewport. In this case, </span><span class="cx">     // calculate the percent \
offset based on this height. </span><span class="cx">     // See \
&lt;https://bugs.webkit.org/show_bug.cgi?id=26396&gt;. </span><ins>+    // Another \
exception is a grid item, as the containing block is the grid area: +    // \
https://drafts.csswg.org/css-grid/#grid-item-sizing </ins><span class="cx">     if \
(!style().top().isAuto() </span><span class="cx">         &amp;&amp; \
(!style().top().isPercentOrCalculated() </span><span class="cx">             || \
!containingBlock()-&gt;hasAutoHeightOrContainingBlockWithAutoHeight() </span><del>-   \
                || containingBlock()-&gt;stretchesToViewport()))
-        offset.expand(0_lu, valueForLength(style().top(), !style().top().isFixed() ? \
                containingBlock()-&gt;availableHeight() : 0_lu));
-
-    else if (!style().bottom().isAuto()
</del><ins>+            || containingBlock()-&gt;stretchesToViewport()
+            || hasOverrideContainingBlockContentHeight())) {
+        // FIXME: The computation of the available height is repeated later for \
&quot;bottom&quot;. +        // We could refactor this and move it to some common \
code for both ifs, however moving it outside of the ifs +        // is not possible \
as it'd cause performance regressions. +        offset.expand(0_lu, \
valueForLength(style().top(), !style().top().isFixed() +            ? \
(hasOverrideContainingBlockContentHeight() ? \
overrideContainingBlockContentHeight().valueOr(0_lu) : \
containingBlock()-&gt;availableHeight()) +            : LayoutUnit()));
+    } else if (!style().bottom().isAuto()
</ins><span class="cx">         &amp;&amp; (!style().bottom().isPercentOrCalculated()
</span><span class="cx">             || \
!containingBlock()-&gt;hasAutoHeightOrContainingBlockWithAutoHeight() </span><del>-   \
                || containingBlock()-&gt;stretchesToViewport()))
-        offset.expand(0_lu, -valueForLength(style().bottom(), \
!style().bottom().isFixed() ? containingBlock()-&gt;availableHeight() : 0_lu)); \
</del><ins>+            || containingBlock()-&gt;stretchesToViewport() +            \
|| hasOverrideContainingBlockContentHeight())) { +        // FIXME: Check comment \
above for &quot;top&quot;, it applies here too. +        offset.expand(0_lu, \
-valueForLength(style().bottom(), !style().bottom().isFixed() +            ? \
(hasOverrideContainingBlockContentHeight() ? \
overrideContainingBlockContentHeight().valueOr(0_lu) : \
containingBlock()-&gt;availableHeight()) +            : LayoutUnit()));
+    }
</ins><span class="cx"> 
</span><span class="cx">     return offset;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjecth"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/WebCore/rendering/RenderBoxModelObject.h (239501 => 239502)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2018-12-21 11:47:28 UTC (rev \
                239501)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2018-12-21 12:29:57 UTC \
(rev 239502) </span><span class="lines">@@ -243,7 +243,12 @@
</span><span class="cx">     virtual LayoutRect paintRectToClipOutFromBorder(const \
LayoutRect&amp;) { return LayoutRect(); }; </span><span class="cx"> 
</span><span class="cx">     bool hasRunningAcceleratedAnimations() const;
</span><del>-    
</del><ins>+
+    virtual Optional&lt;LayoutUnit&gt; overrideContainingBlockContentWidth() const { \
ASSERT_NOT_REACHED(); return -1_lu; } +    virtual Optional&lt;LayoutUnit&gt; \
overrideContainingBlockContentHeight() const { ASSERT_NOT_REACHED(); return -1_lu; } \
+    virtual bool hasOverrideContainingBlockContentWidth() const { return false; } +  \
virtual bool hasOverrideContainingBlockContentHeight() const { return false; } +
</ins><span class="cx"> protected:
</span><span class="cx">     RenderBoxModelObject(Element&amp;, \
RenderStyle&amp;&amp;, BaseTypeFlags); </span><span class="cx">     \
RenderBoxModelObject(Document&amp;, RenderStyle&amp;&amp;, BaseTypeFlags); \
</span></span></pre> </div>
</div>

</body>
</html>



_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic