Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed)

Created:
4 years, 6 months ago by kochi
Modified:
4 years, 5 months ago
Reviewers:
hayato, eae
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, rwlbuis, sof, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement closed shadow adjustment for Element.offsetParent If |offsetParent| is not an unclosed node of the context object, search the layout tree up until an unclosed node is found. |offsetTop| etc. will be adjusted relative to this |offsetParent| value. See also https://github.com/w3c/webcomponents/issues/497 https://github.com/w3c/csswg-drafts/issues/159 for the discussions about spec clarifications. BUG=531990 Committed: https://crrev.com/18d455ee833f6a30dcbe2755380861eb75cd9f6f Cr-Commit-Position: refs/heads/master@{#402757}

Patch Set 1 #

Patch Set 2 : clean up #

Patch Set 3 : rebase #

Total comments: 4

Patch Set 4 : resolve comments #

Total comments: 4

Patch Set 5 : update test expectation #

Patch Set 6 : rename functions, update comment #

Total comments: 2

Patch Set 7 : update #

Patch Set 8 : clean up test #

Patch Set 9 : test #

Total comments: 1

Patch Set 10 : rebase #

Patch Set 11 : *ForBinding #

Total comments: 3

Patch Set 12 : layout test comment update. #

Patch Set 13 : rebase #

Total comments: 2

Patch Set 14 : rebase #

Patch Set 15 : Add a TODO comment #

Patch Set 16 : add one more test, more spec compliant #

Total comments: 1

Patch Set 17 : revert the previous offsetParent change, add one more test #

Patch Set 18 : Re-revert the previous and check position:fixed in layout code. #

Total comments: 2

Patch Set 19 : Add a helper function #

Total comments: 2

Patch Set 20 : Add one more test case. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+394 lines, -79 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow.html View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +244 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +6 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLElement.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 17 2 chunks +44 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLElement.idl View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorHighlight.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +13 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutInline.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutInline.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutVideo.h View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutVideo.cpp View 1 2 3 4 5 6 1 chunk +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/page/PrintContext.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 82 (31 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/1
4 years, 6 months ago (2016-06-09 06:04:10 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/40001
4 years, 6 months ago (2016-06-09 06:39:39 UTC) #6
kochi
PTAL
4 years, 6 months ago (2016-06-09 06:39:54 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/243845)
4 years, 6 months ago (2016-06-09 08:07:40 UTC) #9
hayato
https://codereview.chromium.org/2051703002/diff/40001/third_party/WebKit/Source/core/dom/Node.cpp File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2051703002/diff/40001/third_party/WebKit/Source/core/dom/Node.cpp#newcode651 third_party/WebKit/Source/core/dom/Node.cpp:651: return other.isUnclosedNodeOf(toShadowRoot(root).host()); Is this opposite of the definition? Could ...
4 years, 6 months ago (2016-06-09 08:22:03 UTC) #10
kochi
https://codereview.chromium.org/2051703002/diff/40001/third_party/WebKit/Source/core/dom/Node.cpp File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2051703002/diff/40001/third_party/WebKit/Source/core/dom/Node.cpp#newcode651 third_party/WebKit/Source/core/dom/Node.cpp:651: return other.isUnclosedNodeOf(toShadowRoot(root).host()); On 2016/06/09 08:22:03, hayato wrote: > Is ...
4 years, 6 months ago (2016-06-09 10:49:39 UTC) #11
kochi
@eae, could you take a look at layout/ change? The background is that for getting ...
4 years, 6 months ago (2016-06-09 13:09:28 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/60001
4 years, 6 months ago (2016-06-09 13:10:06 UTC) #15
eae
Logic looks fine but it needs a better name and a comment. https://codereview.chromium.org/2051703002/diff/60001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ...
4 years, 6 months ago (2016-06-09 13:19:42 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/227285)
4 years, 6 months ago (2016-06-09 14:06:53 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/80001
4 years, 6 months ago (2016-06-09 15:45:18 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/100001
4 years, 6 months ago (2016-06-09 16:03:48 UTC) #22
kochi
@eae thanks for the review! I'm now off of any Macs, so I'm not sure ...
4 years, 6 months ago (2016-06-09 16:04:27 UTC) #23
eae
LGTM, thanks for making the suggested changes!
4 years, 6 months ago (2016-06-09 16:07:39 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/241947)
4 years, 6 months ago (2016-06-09 17:43:49 UTC) #26
hayato
NOT lgtm. https://codereview.chromium.org/2051703002/diff/100001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2051703002/diff/100001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp#newcode776 third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:776: Element* element = unclosedOffsetParent(); Why did you ...
4 years, 6 months ago (2016-06-10 01:41:51 UTC) #27
kochi
https://codereview.chromium.org/2051703002/diff/100001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp File third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp (right): https://codereview.chromium.org/2051703002/diff/100001/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp#newcode776 third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp:776: Element* element = unclosedOffsetParent(); On 2016/06/10 01:41:51, hayato wrote: ...
4 years, 6 months ago (2016-06-10 02:07:49 UTC) #28
kochi
@hayato I think I addressed the concern about Layout API breakage in patchset 7. I'm ...
4 years, 6 months ago (2016-06-10 06:29:53 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/160001
4 years, 6 months ago (2016-06-10 06:32:42 UTC) #33
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/242480)
4 years, 6 months ago (2016-06-10 08:15:56 UTC) #35
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/220001
4 years, 6 months ago (2016-06-10 09:21:12 UTC) #38
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/242528)
4 years, 6 months ago (2016-06-10 11:04:43 UTC) #40
hayato
https://codereview.chromium.org/2051703002/diff/220001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/2051703002/diff/220001/third_party/WebKit/Source/core/dom/Element.cpp#newcode638 third_party/WebKit/Source/core/dom/Element.cpp:638: Element* Element::offsetParent() Element::offsetParent() should not use any unclosedXXX check. ...
4 years, 6 months ago (2016-06-10 11:52:28 UTC) #41
kochi
PTAL offsetParent.html test is still failing for mac_rel_chromium_ng. This seems to be a bug in ...
4 years, 6 months ago (2016-06-21 08:26:47 UTC) #43
hayato
I only took a look at the test time. I'll take another look later. https://codereview.chromium.org/2051703002/diff/280001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html ...
4 years, 6 months ago (2016-06-22 03:58:34 UTC) #44
hayato
https://codereview.chromium.org/2051703002/diff/280001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html File third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html (right): https://codereview.chromium.org/2051703002/diff/280001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html#newcode184 third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html:184: assert_equals(inner_node.offsetParent, container); On 2016/06/22 at 03:58:34, hayato wrote: > ...
4 years, 6 months ago (2016-06-22 04:45:35 UTC) #45
kochi
https://codereview.chromium.org/2051703002/diff/280001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html File third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html (right): https://codereview.chromium.org/2051703002/diff/280001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html#newcode184 third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html:184: assert_equals(inner_node.offsetParent, container); On 2016/06/22 04:45:35, hayato wrote: > On ...
4 years, 6 months ago (2016-06-22 06:33:12 UTC) #46
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051703002/320001
4 years, 6 months ago (2016-06-23 02:29:43 UTC) #48
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-23 03:51:47 UTC) #50
kochi
Could you take another look?
4 years, 5 months ago (2016-06-24 11:28:00 UTC) #51
hayato
https://codereview.chromium.org/2051703002/diff/320001/third_party/WebKit/Source/core/html/HTMLElement.cpp File third_party/WebKit/Source/core/html/HTMLElement.cpp (right): https://codereview.chromium.org/2051703002/diff/320001/third_party/WebKit/Source/core/html/HTMLElement.cpp#newcode1096 third_party/WebKit/Source/core/html/HTMLElement.cpp:1096: while (element && (!element->isUnclosedNodeOf(*this) || (element->isInShadowTree() && element->containingShadowRoot()->type() == ...
4 years, 5 months ago (2016-06-27 06:58:32 UTC) #52
kochi
https://codereview.chromium.org/2051703002/diff/320001/third_party/WebKit/Source/core/html/HTMLElement.cpp File third_party/WebKit/Source/core/html/HTMLElement.cpp (right): https://codereview.chromium.org/2051703002/diff/320001/third_party/WebKit/Source/core/html/HTMLElement.cpp#newcode1096 third_party/WebKit/Source/core/html/HTMLElement.cpp:1096: while (element && (!element->isUnclosedNodeOf(*this) || (element->isInShadowTree() && element->containingShadowRoot()->type() == ...
4 years, 5 months ago (2016-06-28 07:59:59 UTC) #53
hayato
On 2016/06/28 at 07:59:59, kochi wrote: > https://codereview.chromium.org/2051703002/diff/320001/third_party/WebKit/Source/core/html/HTMLElement.cpp > File third_party/WebKit/Source/core/html/HTMLElement.cpp (right): > > https://codereview.chromium.org/2051703002/diff/320001/third_party/WebKit/Source/core/html/HTMLElement.cpp#newcode1096 ...
4 years, 5 months ago (2016-06-28 08:20:41 UTC) #54
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2051703002/380001
4 years, 5 months ago (2016-06-29 02:19:09 UTC) #57
kochi
On 2016/06/28 08:20:41, hayato wrote: > On 2016/06/28 at 07:59:59, kochi wrote: > > > ...
4 years, 5 months ago (2016-06-29 02:21:00 UTC) #58
hayato
https://codereview.chromium.org/2051703002/diff/380001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html File third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html (right): https://codereview.chromium.org/2051703002/diff/380001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html#newcode180 third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html:180: <!-- Could you add one more test where it ...
4 years, 5 months ago (2016-06-29 03:53:52 UTC) #59
commit-bot: I haz the power
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_ng/builds/247333)
4 years, 5 months ago (2016-06-29 03:55:07 UTC) #61
kochi
On 2016/06/29 03:53:52, hayato wrote: > https://codereview.chromium.org/2051703002/diff/380001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html > File third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html (right): > > https://codereview.chromium.org/2051703002/diff/380001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html#newcode180 > ...
4 years, 5 months ago (2016-06-29 04:27:58 UTC) #62
hayato
I missed the meaning of 'fixed' in the spec. Please forget the last example. I ...
4 years, 5 months ago (2016-06-29 04:53:46 UTC) #63
kochi
PTAL fixed to return null when 'position: fixed' found inside the closed shadow.
4 years, 5 months ago (2016-06-29 05:09:15 UTC) #65
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2051703002/420001
4 years, 5 months ago (2016-06-29 05:10:24 UTC) #66
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2051703002/440001
4 years, 5 months ago (2016-06-29 05:29:30 UTC) #68
kochi
Updated the CL. PTAL.
4 years, 5 months ago (2016-06-29 05:29:39 UTC) #69
hayato
https://codereview.chromium.org/2051703002/diff/440001/third_party/WebKit/Source/core/layout/LayoutObject.cpp File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/2051703002/diff/440001/third_party/WebKit/Source/core/layout/LayoutObject.cpp#newcode3205 third_party/WebKit/Source/core/layout/LayoutObject.cpp:3205: if (ancestor->isOutOfFlowPositioned() && ancestor->style()->position() == FixedPosition) Could you clean ...
4 years, 5 months ago (2016-06-29 05:42:46 UTC) #70
kochi
https://codereview.chromium.org/2051703002/diff/440001/third_party/WebKit/Source/core/layout/LayoutObject.cpp File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/2051703002/diff/440001/third_party/WebKit/Source/core/layout/LayoutObject.cpp#newcode3205 third_party/WebKit/Source/core/layout/LayoutObject.cpp:3205: if (ancestor->isOutOfFlowPositioned() && ancestor->style()->position() == FixedPosition) On 2016/06/29 05:42:46, ...
4 years, 5 months ago (2016-06-29 06:24:37 UTC) #71
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2051703002/460001
4 years, 5 months ago (2016-06-29 06:25:35 UTC) #73
hayato
lgtm https://codereview.chromium.org/2051703002/diff/460001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html File third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html (right): https://codereview.chromium.org/2051703002/diff/460001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html#newcode185 third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html:185: <div id='host_closed5'> Could you add a test for ...
4 years, 5 months ago (2016-06-29 07:13:12 UTC) #74
kochi
https://codereview.chromium.org/2051703002/diff/460001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html File third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html (right): https://codereview.chromium.org/2051703002/diff/460001/third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html#newcode185 third_party/WebKit/LayoutTests/shadow-dom/offsetParent.html:185: <div id='host_closed5'> On 2016/06/29 07:13:12, hayato wrote: > Could ...
4 years, 5 months ago (2016-06-29 07:29:35 UTC) #75
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2051703002/480001
4 years, 5 months ago (2016-06-29 07:30:22 UTC) #78
commit-bot: I haz the power
Committed patchset #20 (id:480001)
4 years, 5 months ago (2016-06-29 08:52:59 UTC) #80
commit-bot: I haz the power
4 years, 5 months ago (2016-06-29 08:55:52 UTC) #82
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/18d455ee833f6a30dcbe2755380861eb75cd9f6f
Cr-Commit-Position: refs/heads/master@{#402757}

Powered by Google App Engine
This is Rietveld 408576698