|
|
Created:
4 years, 5 months ago by Manuel Rego Modified:
4 years, 5 months ago CC:
chromium-reviews, jfernandez, szager+layoutwatch_chromium.org, zoltan1, svillar, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, leviw+renderwatch, jchaffraix+rendering, blink-reviews, eae+blinkwatch Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Description[css-grid] Fix percentage height resolution for replaced elements
The percentage heights for replaced elements were not working
as expected in grid items.
The patch fixes the different issues to make it work as expected.
If a replaced item is a grid item, it needs to resolve
the percentage height against its grid area.
When the replaced item is a child of a grid item,
and the grid item is stretched,
it needs to use that size to resolve the percentage height too.
BUG=624716
TEST=fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html
Committed: https://crrev.com/7886bec673ccae048c0ef5726ceb21c8fcbd86e0
Cr-Commit-Position: refs/heads/master@{#404896}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Make hasAutoHeightOrContainingBlockWithAutoHeight(bool) private #
Messages
Total messages: 44 (18 generated)
rego@igalia.com changed reviewers: + cbiesinger@chromium.org, jfernandez@igalia.com, svillar@igalia.com
Won't give my OK as I don't really know what this funcion is used for, I'll let others decide. https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:558: bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const It's usually considered better to use an enum instead of a boolean, you might need to add some other values later.
rego@igalia.com changed reviewers: + eae@chromium.org
On 2016/07/07 11:45:48, svillar wrote: > Won't give my OK as I don't really know what this funcion is used for, I'll let > others decide. Adding @eae as reviewer then, as he reviewed similar fixes on Flexbox. https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:558: bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const On 2016/07/07 11:45:48, svillar wrote: > It's usually considered better to use an enum instead of a boolean, you might > need to add some other values later. Ok, I can change this I'm thinking in something like: enum ObjectToCheck { CurrentObject, ContainingBlock }; bool hasAutoHeightOrContainingBlockWithAutoHeight(ObjectToCheck = CurrentObject) const; But I don't like it. :-/ Do you have a better suggestion? Thanks.
https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:558: bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const On 2016/07/07 14:40:57, Manuel Rego wrote: > On 2016/07/07 11:45:48, svillar wrote: > > It's usually considered better to use an enum instead of a boolean, you might > > need to add some other values later. > > Ok, I can change this I'm thinking in something like: > enum ObjectToCheck { CurrentObject, ContainingBlock }; > bool hasAutoHeightOrContainingBlockWithAutoHeight(ObjectToCheck = > CurrentObject) const; > > But I don't like it. :-/ Do you have a better suggestion? Thanks. To make sure I understand, callers should never pass true here, right? This is only used for the internal implementation? I'd be OK with keeping it as a bool in that circumstance, but can you add a comment in the header saying that this is the case?
https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:558: bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const On 2016/07/07 17:34:27, cbiesinger wrote: > On 2016/07/07 14:40:57, Manuel Rego wrote: > > On 2016/07/07 11:45:48, svillar wrote: > > > It's usually considered better to use an enum instead of a boolean, you > might > > > need to add some other values later. > > > > Ok, I can change this I'm thinking in something like: > > enum ObjectToCheck { CurrentObject, ContainingBlock }; > > bool hasAutoHeightOrContainingBlockWithAutoHeight(ObjectToCheck = > > CurrentObject) const; > > > > But I don't like it. :-/ Do you have a better suggestion? Thanks. > > To make sure I understand, callers should never pass true here, right? This is > only used for the internal implementation? > > I'd be OK with keeping it as a bool in that circumstance, but can you add a > comment in the header saying that this is the case? Yeah that's the idea. Probably it'd be better that the public method has not arguments (like before). And then we've a private method with the bool. E.g. public: bool hasAutoHeightOrContainingBlockWithAutoHeight() const { return hasAutoHeightOrContainingBlockWithAutoHeight(false); } private: bool hasAutoHeightOrContainingBlockWithAutoHeight(bool checkingContainingBlock) const { ... } WDYT?
On 2016/07/08 07:57:04, Manuel Rego wrote: > https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... > File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): > > https://codereview.chromium.org/2121173002/diff/1/third_party/WebKit/Source/c... > third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:558: bool > LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool > checkingContainingBlock) const > On 2016/07/07 17:34:27, cbiesinger wrote: > > On 2016/07/07 14:40:57, Manuel Rego wrote: > > > On 2016/07/07 11:45:48, svillar wrote: > > > > It's usually considered better to use an enum instead of a boolean, you > > might > > > > need to add some other values later. > > > > > > Ok, I can change this I'm thinking in something like: > > > enum ObjectToCheck { CurrentObject, ContainingBlock }; > > > bool hasAutoHeightOrContainingBlockWithAutoHeight(ObjectToCheck = > > > CurrentObject) const; > > > > > > But I don't like it. :-/ Do you have a better suggestion? Thanks. > > > > To make sure I understand, callers should never pass true here, right? This is > > only used for the internal implementation? > > > > I'd be OK with keeping it as a bool in that circumstance, but can you add a > > comment in the header saying that this is the case? > > Yeah that's the idea. > > Probably it'd be better that the public method has not arguments (like before). > And then we've a private method with the bool. E.g. > public: > bool hasAutoHeightOrContainingBlockWithAutoHeight() const { > return hasAutoHeightOrContainingBlockWithAutoHeight(false); > } > private: > bool hasAutoHeightOrContainingBlockWithAutoHeight(bool > checkingContainingBlock) const { > ... > } > > WDYT? Sounds good
Ok, so I've just uploaded a new version making hasAutoHeightOrContainingBlockWithAutoHeight(bool) private. PTAL, thanks!
lgtm
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
LGTM
The CQ bit was checked by eae@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rego@igalia.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== [css-grid] Fix percentage height resolution for replaced elements The percentage heights for replaced elements were not working as expected in grid items. The patch fixes the different issues to make it work as expected. If a replaced item is a grid item, it needs to resolve the percentage height against its grid area. When the replaced item is a child of a grid item, and the grid item is stretched, it needs to use that size to resolve the percentage height too. BUG=624716 TEST=fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html ========== to ========== [css-grid] Fix percentage height resolution for replaced elements The percentage heights for replaced elements were not working as expected in grid items. The patch fixes the different issues to make it work as expected. If a replaced item is a grid item, it needs to resolve the percentage height against its grid area. When the replaced item is a child of a grid item, and the grid item is stretched, it needs to use that size to resolve the percentage height too. BUG=624716 TEST=fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html Committed: https://crrev.com/7886bec673ccae048c0ef5726ceb21c8fcbd86e0 Cr-Commit-Position: refs/heads/master@{#404896} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/7886bec673ccae048c0ef5726ceb21c8fcbd86e0 Cr-Commit-Position: refs/heads/master@{#404896} |