|
|
Chromium Code Reviews|
Created:
3 years, 7 months ago by szager1 Modified:
3 years, 7 months ago CC:
chromium-reviews, pdr+renderingwatchlist_chromium.org, zoltan1, blink-reviews-layout_chromium.org, szager+layoutwatch_chromium.org, eae+blinkwatch, leviw+renderwatch, dshwang, jchaffraix+rendering, blink-reviews-paint_chromium.org, blink-reviews Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionUpdate layer size from LayoutBox::UpdateAfterLayout
Previously, layer size was set during a post-layout call to
PaintLayer::UpdateLayerPositions. With this change,
layer size is updated during layout, as soon as the new size is
available (after its owning LayoutBox has finished layout).
BUG=701575
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Review-Url: https://codereview.chromium.org/2854213004
Cr-Commit-Position: refs/heads/master@{#472387}
Committed: https://chromium.googlesource.com/chromium/src/+/2088149da693bad956c1b2f2fc4e58fa0eedbab8
Patch Set 1 #Patch Set 2 : rebase #Patch Set 3 : rebase #Patch Set 4 : Update layer size if position changes. #Patch Set 5 : rebase #
Total comments: 11
Patch Set 6 : rebase #Patch Set 7 : Sensible return value for PaintLayer::UpdateSize #Patch Set 8 : Fix placement of inline comment #
Messages
Total messages: 45 (32 generated)
Description was changed from ========== Update layer size from LayoutBox::UpdateAfterLayout Previously, layer size was set during a post-layout call to PaintLayer::UpdateLayerPositions. With this change, layer size is updated during layout, as soon as the new size is available (after its owning LayoutBox has finished layout). BUG=701575 ========== to ========== Update layer size from LayoutBox::UpdateAfterLayout Previously, layer size was set during a post-layout call to PaintLayer::UpdateLayerPositions. With this change, layer size is updated during layout, as soon as the new size is available (after its owning LayoutBox has finished layout). BUG=701575 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ==========
The CQ bit was checked by szager@chromium.org to run a CQ dry run
Dry run: 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
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by szager@chromium.org to run a CQ dry run
Dry run: 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
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by szager@chromium.org to run a CQ dry run
Dry run: 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
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by szager@chromium.org to run a CQ dry run
Description was changed from ========== Update layer size from LayoutBox::UpdateAfterLayout Previously, layer size was set during a post-layout call to PaintLayer::UpdateLayerPositions. With this change, layer size is updated during layout, as soon as the new size is available (after its owning LayoutBox has finished layout). BUG=701575 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ========== to ========== Update layer size from LayoutBox::UpdateAfterLayout Previously, layer size was set during a post-layout call to PaintLayer::UpdateLayerPositions. With this change, layer size is updated during layout, as soon as the new size is available (after its owning LayoutBox has finished layout). BUG=701575 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ==========
szager@chromium.org changed reviewers: + bokan@chromium.org
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
This CL is the coup de grâce. It clears up all kinds of issues for root layer scrolling.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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 szager@chromium.org to run a CQ dry run
Dry run: 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
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:664: child.SetLocationAndUpdateOverflowControlsIfNeeded(new_location); Should we not do this for the SetLogicalTopForChild method below too? https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:334: // FIXME: We should call a specialized versions of this function. The FIXME should be moved down since it refers to UpdateLayerPositionsAfterLayout (do you know what it means? what specialised versions?) https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/paint/PaintLayer.cpp:792: // LayoutBox::UpdateAfterLayout, but LayoutInlines will still need to update This may be a naive question as I'm a layout-outsider, but what makes inlines special here? Why can't they call UpdateSizeAndScrollingAfterLayout after they layout/get their size in the same way a LayoutBox does? I noticed that LayoutInline::UpdateLayout is a NOTREACHED so I'm guessing it's special somehow; how does an inline get its size? https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/paint/PaintLayer.cpp:877: scrollable_area_->VisibleSizeChanged(); Any reason not to put this in UpdateSize().
https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:664: child.SetLocationAndUpdateOverflowControlsIfNeeded(new_location); On 2017/05/12 15:58:17, bokan wrote: > Should we not do this for the SetLogicalTopForChild method below too? No, because SetLogicalTopForChild is called *before* the child runs layout (as opposed to this method, which is called *after* the child runs layout). https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:334: // FIXME: We should call a specialized versions of this function. On 2017/05/12 15:58:18, bokan wrote: > The FIXME should be moved down since it refers to > UpdateLayerPositionsAfterLayout (do you know what it means? what specialised > versions?) The comment was added here: https://codereview.chromium.org/443773002/ I'm not sure whether it refers to the fact that in this case, it's not being called after layout. Or maybe it's because UpdateLayerPositionsAfterLayout is recursive, but there's no need to recurse here (because a brand-new layer won't have any child layers). I'm not really sure. https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/paint/PaintLayer.cpp:792: // LayoutBox::UpdateAfterLayout, but LayoutInlines will still need to update On 2017/05/12 15:58:18, bokan wrote: > This may be a naive question as I'm a layout-outsider, but what makes inlines > special here? Why can't they call UpdateSizeAndScrollingAfterLayout after they > layout/get their size in the same way a LayoutBox does? I noticed that > LayoutInline::UpdateLayout is a NOTREACHED so I'm guessing it's special somehow; > how does an inline get its size? LayoutInline's don't run their own layout; instead, their parent LayoutBlockFlow creates a line box tree (instances of InlineFlowBox) and lays them out. LayoutInline gets its geometry from the geometry of its constituent InlineFlowBox'es. LayoutBlockFlow iterates over the line box tree when running layout, so there isn't currently an iteration over LayoutInline's where we can call UpdateSizeAndScrollingAfterLayout. I could add an iteration to do this in LayoutBlockFlow::LayoutInlineChildren, after the call to LayoutRunsAndFloats, but I don't really think it's worth the performance cost. https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/paint/PaintLayer.cpp:877: scrollable_area_->VisibleSizeChanged(); On 2017/05/12 15:58:18, bokan wrote: > Any reason not to put this in UpdateSize(). UpdateSize is also called from LayoutBoxModelObject::StyleDidChange, but it's not safe to call into scrollable_area_ at that point.
szager@chromium.org changed reviewers: + skobes@chromium.org
+skobes
https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:334: // FIXME: We should call a specialized versions of this function. On 2017/05/12 19:12:12, szager1 wrote: > On 2017/05/12 15:58:18, bokan wrote: > > The FIXME should be moved down since it refers to > > UpdateLayerPositionsAfterLayout (do you know what it means? what specialised > > versions?) > > The comment was added here: > > https://codereview.chromium.org/443773002/ > > I'm not sure whether it refers to the fact that in this case, it's not being > called after layout. Or maybe it's because UpdateLayerPositionsAfterLayout is > recursive, but there's no need to recurse here (because a brand-new layer won't > have any child layers). I'm not really sure. I'm guessing the former (not after layout). https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/paint/PaintLayer.cpp:863: size_ = line_box.Size(); Why is did_resize not set in this branch?
szager@google.com changed reviewers: + szager@google.com
https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/paint/PaintLayer.cpp (right): https://codereview.chromium.org/2854213004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/paint/PaintLayer.cpp:863: size_ = line_box.Size(); On 2017/05/16 22:22:22, skobes wrote: > Why is did_resize not set in this branch? This preserves the existing logic. did_resize is only used to decide whether to call PLSA->VisibleSizeChanged(). A LayoutInline can't be scrollable, so size changes to LayoutInline's are not interesting. Having said that: now that UpdateSize is a separate, public method, it makes no sense to preserve that logic, and it won't affect anything in the existing code, so I changed it so that did_resize will be set for inlines that change size.
lgtm
The CQ bit was checked by szager@google.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 szager@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_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 szager@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 140001, "attempt_start_ts": 1495007747352620,
"parent_rev": "b71ba396c9975c119cee6632c8e78695c0771e69", "commit_rev":
"2088149da693bad956c1b2f2fc4e58fa0eedbab8"}
Message was sent while issue was closed.
Description was changed from ========== Update layer size from LayoutBox::UpdateAfterLayout Previously, layer size was set during a post-layout call to PaintLayer::UpdateLayerPositions. With this change, layer size is updated during layout, as soon as the new size is available (after its owning LayoutBox has finished layout). BUG=701575 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 ========== to ========== Update layer size from LayoutBox::UpdateAfterLayout Previously, layer size was set during a post-layout call to PaintLayer::UpdateLayerPositions. With this change, layer size is updated during layout, as soon as the new size is available (after its owning LayoutBox has finished layout). BUG=701575 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2854213004 Cr-Commit-Position: refs/heads/master@{#472387} Committed: https://chromium.googlesource.com/chromium/src/+/2088149da693bad956c1b2f2fc4e... ==========
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as https://chromium.googlesource.com/chromium/src/+/2088149da693bad956c1b2f2fc4e... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
