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

Issue 13792002: Fix <dialog> centering (Closed)

Created:
7 years, 8 months ago by falken
Modified:
7 years, 8 months ago
CC:
blink-reviews, Nate Chapin, Alexis Menard, jchaffraix+rendering, abarth-chromium
Visibility:
Public.

Description

Fix <dialog> centering This patch: 1) Forces a sync layout on dialog.show() and then computes the top value that would center the dialog. 2) Uses customStyleForRenderer to center the dialog. This satisfies the spec that dialog is centered only on dialog.show() and not re-centered on subsequent relayouts. Before this patch, <dialog> centering occurred during dialog's layout, which doesn't work because it incorrectly depends on dialog's ancestors having been already laid out. Furthermore, it recentered on a relayout. This patch just does vertical centering. It does not do horizontal centering and doesn't work well with writing-mode. BUG=232268 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=148615

Patch Set 1 #

Total comments: 3

Patch Set 2 : get working for relpos #

Total comments: 1

Patch Set 3 : new approach: adjust RenderStyle in attach #

Patch Set 4 : override top on style recalc, and don't make dialog's cb the icb #

Patch Set 5 : use hasCustomStyleCallbacks #

Total comments: 10

Patch Set 6 : review comments and try reparenting by RenderView again #

Patch Set 7 : just do centering in this patch, no reparenting logic #

Patch Set 8 : fix use of PassRefPtr #

Total comments: 12

Patch Set 9 : sync #

Patch Set 10 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -200 lines) Patch
M LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning.html View 1 2 3 4 5 6 3 chunks +116 lines, -63 lines 0 comments Download
M LayoutTests/fast/dom/HTMLDialogElement/non-anchored-dialog-positioning-expected.txt View 1 2 3 4 5 6 1 chunk +47 lines, -3 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLDialogElement.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -1 line 0 comments Download
M Source/core/html/HTMLDialogElement.cpp View 1 2 3 4 5 6 7 8 9 6 chunks +54 lines, -7 lines 0 comments Download
D Source/core/rendering/RenderDialog.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -55 lines 0 comments Download
D Source/core/rendering/RenderDialog.cpp View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -70 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
falken
Hi Julien and Ojan, Back to dialog centering! Our approach #2, using static block position ...
7 years, 8 months ago (2013-04-08 13:07:35 UTC) #1
esprehn
https://codereview.chromium.org/13792002/diff/1/Source/WebCore/dom/NodeRenderingContext.cpp File Source/WebCore/dom/NodeRenderingContext.cpp (right): https://codereview.chromium.org/13792002/diff/1/Source/WebCore/dom/NodeRenderingContext.cpp#newcode157 Source/WebCore/dom/NodeRenderingContext.cpp:157: if (m_node->hasTagName(dialogTag)) { This is just for testing right?
7 years, 8 months ago (2013-04-09 02:24:31 UTC) #2
falken
https://codereview.chromium.org/13792002/diff/1/Source/WebCore/dom/NodeRenderingContext.cpp File Source/WebCore/dom/NodeRenderingContext.cpp (right): https://codereview.chromium.org/13792002/diff/1/Source/WebCore/dom/NodeRenderingContext.cpp#newcode157 Source/WebCore/dom/NodeRenderingContext.cpp:157: if (m_node->hasTagName(dialogTag)) { On 2013/04/09 02:24:31, Elliott Sprehn wrote: ...
7 years, 8 months ago (2013-04-09 02:30:26 UTC) #3
esprehn
On 2013/04/09 02:30:26, falken wrote: > https://codereview.chromium.org/13792002/diff/1/Source/WebCore/dom/NodeRenderingContext.cpp > File Source/WebCore/dom/NodeRenderingContext.cpp (right): > > https://codereview.chromium.org/13792002/diff/1/Source/WebCore/dom/NodeRenderingContext.cpp#newcode157 > ...
7 years, 8 months ago (2013-04-09 02:32:24 UTC) #4
falken
On 2013/04/09 02:32:24, Elliott Sprehn wrote: > On 2013/04/09 02:30:26, falken wrote: > > > ...
7 years, 8 months ago (2013-04-09 06:37:49 UTC) #5
esprehn
On 2013/04/09 06:37:49, falken wrote: > ... > Maybe dialog can just override containingBlock() to ...
7 years, 8 months ago (2013-04-09 06:42:27 UTC) #6
eseidel
Do we not already have other examples in the rendering tree of objects which reach ...
7 years, 8 months ago (2013-04-09 07:40:55 UTC) #7
falken
Maybe got it working for relpos! But it's still not ready for formal review. On ...
7 years, 8 months ago (2013-04-09 10:35:51 UTC) #8
eseidel
Positioned children bust out of their containing block, no? This is sorta like that except ...
7 years, 8 months ago (2013-04-09 19:59:36 UTC) #9
falken
On 2013/04/09 19:59:36, Eric Seidel (Google) wrote: > Positioned children bust out of their containing ...
7 years, 8 months ago (2013-04-10 08:19:24 UTC) #10
falken
Uploaded a new WIP patch that does the new approach, storing top on HTMLDialogElement and ...
7 years, 8 months ago (2013-04-11 10:14:47 UTC) #11
falken
I think it's ready for review! Some notes: - Changing containingBlock() to return RenderView for ...
7 years, 8 months ago (2013-04-12 08:20:47 UTC) #12
esprehn
On 2013/04/12 08:20:47, falken wrote: > I think it's ready for review! > > Some ...
7 years, 8 months ago (2013-04-12 08:49:12 UTC) #13
falken
I updated the patch to use hasCustomStyleCallbacks. On 2013/04/12 08:49:12, esprehn wrote: > On 2013/04/12 ...
7 years, 8 months ago (2013-04-12 10:17:29 UTC) #14
esprehn
Looks much better. This isn't optimal, but this feature is behind a flag so we ...
7 years, 8 months ago (2013-04-16 08:32:06 UTC) #15
falken
Elliott thanks for the review! I've updated the patch based on your comments. I'm also ...
7 years, 8 months ago (2013-04-16 12:02:14 UTC) #16
falken
Elliott, please take another look. I've removed the reparenting logic from this patch and will ...
7 years, 8 months ago (2013-04-17 04:33:28 UTC) #17
Julien - ping for review
LGTM with the following conditions: * fix what is pointed out here. * add a ...
7 years, 8 months ago (2013-04-17 22:12:25 UTC) #18
falken
Thanks for the review! On 2013/04/17 22:12:25, Julien Chaffraix wrote: > * add a FIXME ...
7 years, 8 months ago (2013-04-18 01:46:57 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/13792002/36002
7 years, 8 months ago (2013-04-18 04:27:26 UTC) #20
commit-bot: I haz the power
7 years, 8 months ago (2013-04-18 05:11:02 UTC) #21
Message was sent while issue was closed.
Change committed as 148615

Powered by Google App Engine
This is Rietveld 408576698