Bug 190492 - [css-grid] Fix percentages in relative offsets for grid items
Summary: [css-grid] Fix percentages in relative offsets for grid items
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
URL:
Keywords: BlinkMergeCandidate, InRadar
Depends on:
Blocks:
 
Reported: 2018-10-11 14:58 PDT by Manuel Rego Casasnovas
Modified: 2018-12-21 04:31 PST (History)
8 users (show)

See Also:


Attachments
Patch (27.08 KB, patch)
2018-10-11 15:12 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Rebased patch (16.41 KB, patch)
2018-12-20 14:24 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Rebased patch (16.40 KB, patch)
2018-12-20 14:55 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Apply suggested changes (16.35 KB, patch)
2018-12-20 15:00 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rego Casasnovas 2018-10-11 14:58:45 PDT
There are issues if you use position relative and percentage offsets in grid items.
This has been already fixed in Blink: https://bugs.chromium.org/p/chromium/issues/detail?id=835607
Comment 1 Manuel Rego Casasnovas 2018-10-11 15:12:58 PDT
Created attachment 352088 [details]
Patch
Comment 2 Sergio Villar Senin 2018-10-16 09:31:46 PDT
Comment on attachment 352088 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352088&action=review

Looks good overall. However I am not sure whether this change could cause performance regressions. See bellow, have you observed any significant change in Blink?

> Source/WebCore/rendering/RenderBoxModelObject.cpp:426
> +    bool hasOverrideContainingBlockContent = hasOverrideContainingBlockContentHeight();

You're unconditionally adding a hashmap query here. I think it's better to have the call inside the if so we can shortcircuit it if any of the previous conditions is already true.

On the other hand it might be the case that we need to call it twice in the worst case...
Comment 3 Javier Fernandez 2018-10-17 01:47:06 PDT
Comment on attachment 352088 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352088&action=review

>> Source/WebCore/rendering/RenderBoxModelObject.cpp:426
>> +    bool hasOverrideContainingBlockContent = hasOverrideContainingBlockContentHeight();
> 
> You're unconditionally adding a hashmap query here. I think it's better to have the call inside the if so we can shortcircuit it if any of the previous conditions is already true.
> 
> On the other hand it might be the case that we need to call it twice in the worst case...

We should get rid of the hashmap to manage the RenderBox override size, as we do in Blink. 

About this specific case, I wouldn't complicate the code because of performance, since we'll probably get rid of the hashmap in the near future.
Comment 4 Manuel Rego Casasnovas 2018-10-17 08:44:24 PDT
Comment on attachment 352088 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352088&action=review

>>> Source/WebCore/rendering/RenderBoxModelObject.cpp:426
>>> +    bool hasOverrideContainingBlockContent = hasOverrideContainingBlockContentHeight();
>> 
>> You're unconditionally adding a hashmap query here. I think it's better to have the call inside the if so we can shortcircuit it if any of the previous conditions is already true.
>> 
>> On the other hand it might be the case that we need to call it twice in the worst case...
> 
> We should get rid of the hashmap to manage the RenderBox override size, as we do in Blink. 
> 
> About this specific case, I wouldn't complicate the code because of performance, since we'll probably get rid of the hashmap in the near future.

We're getting some issues in Blink, so until we stablize the code there I don't think it makes sense to merge this on WebKit.
Comment 5 Manuel Rego Casasnovas 2018-12-20 14:24:25 PST
Created attachment 357871 [details]
Rebased patch
Comment 6 Manuel Rego Casasnovas 2018-12-20 14:55:16 PST
Created attachment 357874 [details]
Rebased patch
Comment 7 Manuel Rego Casasnovas 2018-12-20 15:00:59 PST
Created attachment 357875 [details]
Apply suggested changes
Comment 8 Manuel Rego Casasnovas 2018-12-20 15:01:55 PST
Comment on attachment 352088 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=352088&action=review

Thanks for the reviews. PTAL.

>>>> Source/WebCore/rendering/RenderBoxModelObject.cpp:426
>>>> +    bool hasOverrideContainingBlockContent = hasOverrideContainingBlockContentHeight();
>>> 
>>> You're unconditionally adding a hashmap query here. I think it's better to have the call inside the if so we can shortcircuit it if any of the previous conditions is already true.
>>> 
>>> On the other hand it might be the case that we need to call it twice in the worst case...
>> 
>> We should get rid of the hashmap to manage the RenderBox override size, as we do in Blink. 
>> 
>> About this specific case, I wouldn't complicate the code because of performance, since we'll probably get rid of the hashmap in the near future.
> 
> We're getting some issues in Blink, so until we stablize the code there I don't think it makes sense to merge this on WebKit.

The code in Blink seems to have stabilized.

I'm applying the change suggested by Sergio on the last version of this patch.
Comment 9 WebKit Commit Bot 2018-12-21 04:30:05 PST
Comment on attachment 357875 [details]
Apply suggested changes

Clearing flags on attachment: 357875

Committed r239502: <https://trac.webkit.org/changeset/239502>
Comment 10 WebKit Commit Bot 2018-12-21 04:30:07 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2018-12-21 04:31:34 PST
<rdar://problem/46898273>