|
|
Created:
4 years, 2 months ago by Karl Øygard Modified:
4 years, 1 month ago CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1 Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMake offsetTop/Left handle a relative positioned inline offsetParent correctly.
offsetTop and offsetLeft happily ignored the fact that offsetParent could
be a relative positioned inline.
I used the opportunity to change some variable names in
LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully
make it clearer what's going on.
BUG=638184
Committed: https://crrev.com/f903f01899c880f15af678b6e44404a7d9b1735f
Cr-Commit-Position: refs/heads/master@{#429571}
Patch Set 1 #Patch Set 2 : Expanded test cases and renamed method and some variables. #Patch Set 3 : Removed faulty test case and further renamed method. #Patch Set 4 : Fix for out of flow positioned elements. #Patch Set 5 : Better fix for out of flow positioned elements. #Patch Set 6 : Fixed crasher when offsetParent is body. #Patch Set 7 : Only call offsetForInFlowPositionedInline with abspos children. #Patch Set 8 : Added one more test for abspos with relpos inline offsetParent. #
Total comments: 4
Patch Set 9 : Changes according to review. #
Total comments: 5
Patch Set 10 : Rebased patch and made changes according to review. #Patch Set 11 : Fixed broken rebase. #
Messages
Total messages: 71 (55 generated)
The CQ bit was checked by karlo@opera.com 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.
Description was changed from ========== Make offsetTop/Left pay attention to an in flow positioned offsetParent. BUG=638184 ========== to ========== Make offsetTop/Left pay attention to an in flow positioned offsetParent. offsetTop and offsetLeft would ignore the fact that the offsetParent could be a relative positioned inline. BUG=638184 ==========
Description was changed from ========== Make offsetTop/Left pay attention to an in flow positioned offsetParent. offsetTop and offsetLeft would ignore the fact that the offsetParent could be a relative positioned inline. BUG=638184 ========== to ========== Make offsetTop/Left pay attention to an in flow positioned offsetParent. offsetTop and offsetLeft happily ignored the fact that the offsetParent could be a relative positioned inline. BUG=638184 ==========
Description was changed from ========== Make offsetTop/Left pay attention to an in flow positioned offsetParent. offsetTop and offsetLeft happily ignored the fact that the offsetParent could be a relative positioned inline. BUG=638184 ========== to ========== Make offsetTop/Left handle a relative positioned inline offsetParent correctly. offsetTop and offsetLeft happily ignored the fact that offsetParent could be a relative positioned inline. I used the opportunity to change some variable names in LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully make it clearer what's going on. BUG=638184 ==========
The CQ bit was checked by karlo@opera.com 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.
The CQ bit was checked by karlo@opera.com 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 checked by karlo@opera.com 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: 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 karlo@opera.com 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: 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 karlo@opera.com 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: 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 karlo@opera.com 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.
The CQ bit was checked by karlo@opera.com 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.
karlo@opera.com changed reviewers: + cbiesinger@chromium.org
ptal
ikilpatrick@chromium.org changed reviewers: + atotic@chromium.org, ikilpatrick@chromium.org
cbiesinger@chromium.org changed reviewers: + mstensho@opera.com
I've assisted karlo a bit with this patch, so I would be good if someone other than me could review it.
https://codereview.chromium.org/2414683002/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2414683002/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1028: referencePoint += toLayoutBox(offsetParentObject)->topLeftLocation(); Why replace moveBy with '+='? moveBy is used throughtout this method, lets stay consistent. https://codereview.chromium.org/2414683002/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1032: const LayoutInline* inlineParent = toLayoutInline(offsetParentObject); I am not very familiar with this code. Can you explain what this fixes, and why does the fix work?
https://codereview.chromium.org/2414683002/diff/140001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2414683002/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1028: referencePoint += toLayoutBox(offsetParentObject)->topLeftLocation(); On 2016/10/25 19:28:58, atotic2 wrote: > Why replace moveBy with '+='? > > moveBy is used throughtout this method, lets stay consistent. It was just done to conserve line space for cosmetic reasons, moveBy() pushes the line above 80 characters. I can revert this. https://codereview.chromium.org/2414683002/diff/140001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1032: const LayoutInline* inlineParent = toLayoutInline(offsetParentObject); On 2016/10/25 19:28:58, atotic2 wrote: > I am not very familiar with this code. > > Can you explain what this fixes, and why does the fix work? This covers the case when offsetParent is an inline (and in flow positioned). In that case, we need to subtract the line position of the offsetParent. Additionally, absolute positioned children may or may not already be placed on the line, offsetForInFlowPositionedInline() handles that. I'll add a comment to clarify this a little.
The CQ bit was checked by karlo@opera.com 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.
ikilpatrick@chromium.org changed reviewers: - ikilpatrick@chromium.org
ptal. I reverted the code to moveBy() as requested, and added a small comment to the handling of absolute positioned children.
On 2016/10/31 at 11:46:50, karlo wrote: > ptal. I reverted the code to moveBy() as requested, and added a small comment > to the handling of absolute positioned children. lgtm with nits.
https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1033: if (offsetParentObject->isLayoutInline()) { Can offsetParentObject be null here? We're checking for null at 1006. https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1038: // Absolute positioned objects need to be placed on the line This still leaves me wondering: - "on the line" with respect to what? What do you think about: "Offset for absolute elements with inline parent is a special case in DOM spec." Because the real work of how this special case works is inside offsetForInFlowPositionedInline https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1039: Remove blank line
https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1033: if (offsetParentObject->isLayoutInline()) { On 2016/10/31 22:54:25, atotic2 wrote: > Can offsetParentObject be null here? We're checking for null at 1006. offsetParentObject is checked for null in an if statement above, and is not subsequently modified, so should be fine. https://codereview.chromium.org/2414683002/diff/160001/third_party/WebKit/Sou... third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:1038: // Absolute positioned objects need to be placed on the line On 2016/10/31 22:54:25, atotic2 wrote: > This still leaves me wondering: > - "on the line" with respect to what? > > What do you think about: > > "Offset for absolute elements with inline parent is a special case in DOM spec." > > Because the real work of how this special case works is inside > offsetForInFlowPositionedInline Agreed, I have amended the comment accordingly.
The CQ bit was checked by karlo@opera.com 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: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) linux_chromium_chromeos_ozone_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 karlo@opera.com 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.
The CQ bit was checked by karlo@opera.com
The patchset sent to the CQ was uploaded after l-g-t-m from atotic@chromium.org Link to the patchset: https://codereview.chromium.org/2414683002/#ps200001 (title: "Fixed broken rebase.")
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
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full committers or once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer, _not_ a full super star committer. See http://www.chromium.org/getting-involved/become-a-committer Note that this has nothing to do with OWNERS files.
The CQ bit was checked by mstensho@opera.com
lgtm
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.
Description was changed from ========== Make offsetTop/Left handle a relative positioned inline offsetParent correctly. offsetTop and offsetLeft happily ignored the fact that offsetParent could be a relative positioned inline. I used the opportunity to change some variable names in LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully make it clearer what's going on. BUG=638184 ========== to ========== Make offsetTop/Left handle a relative positioned inline offsetParent correctly. offsetTop and offsetLeft happily ignored the fact that offsetParent could be a relative positioned inline. I used the opportunity to change some variable names in LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully make it clearer what's going on. BUG=638184 ==========
Message was sent while issue was closed.
Committed patchset #11 (id:200001)
Message was sent while issue was closed.
Description was changed from ========== Make offsetTop/Left handle a relative positioned inline offsetParent correctly. offsetTop and offsetLeft happily ignored the fact that offsetParent could be a relative positioned inline. I used the opportunity to change some variable names in LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully make it clearer what's going on. BUG=638184 ========== to ========== Make offsetTop/Left handle a relative positioned inline offsetParent correctly. offsetTop and offsetLeft happily ignored the fact that offsetParent could be a relative positioned inline. I used the opportunity to change some variable names in LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully make it clearer what's going on. BUG=638184 Committed: https://crrev.com/f903f01899c880f15af678b6e44404a7d9b1735f Cr-Commit-Position: refs/heads/master@{#429571} ==========
Message was sent while issue was closed.
Patchset 11 (id:??) landed as https://crrev.com/f903f01899c880f15af678b6e44404a7d9b1735f Cr-Commit-Position: refs/heads/master@{#429571} |